remoteproc: drivers: update enable_interrupt()
authorWendy Liang <jliang@xilinx.com>
Wed, 25 Jan 2017 22:51:41 +0000 (14:51 -0800)
committerWendy Liang <jliang@xilinx.com>
Fri, 3 Feb 2017 21:41:24 +0000 (13:41 -0800)
Update enable_interrupt() for all the drivers to use
new hil proc enable_interrupt API.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/remoteproc/drivers/linux_remoteproc.c
lib/remoteproc/drivers/zynq_remoteproc_a9.c
lib/remoteproc/drivers/zynqmp_remoteproc_a53.c
lib/remoteproc/drivers/zynqmp_remoteproc_r5.c

index 79157f1ea1efad044c7c1bfec18c6b246395fc5a..d54412fdb44f5f7109e051f8929702b743a1a970 100644 (file)
@@ -73,7 +73,7 @@ struct vring_ipi_info {
 
 /*--------------------------- Declare Functions ------------------------ */
 static int _ipi_handler(int vect_id, void *data);
-static int _enable_interrupt(struct proc_vring *vring_hw);
+static int _enable_interrupt(struct proc_intr *intr);
 static void _notify(struct hil_proc *proc, struct proc_intr *intr_info);
 static int _boot_cpu(struct hil_proc *proc, unsigned int load_addr);
 static void _shutdown_cpu(struct hil_proc *proc);
@@ -165,20 +165,20 @@ static int event_open(const char *descr)
 
 static int _ipi_handler(int vect_id, void *data)
 {
-       (void) vect_id;
-       (void) data;
        char dummy_buf[32];
-       struct proc_vring *vring_hw = (struct proc_vring *)(data);
-       struct vring_ipi_info *ipi =
-               (struct vring_ipi_info *)(vring_hw->intr_info.data);
+       struct proc_intr *intr = data;
+       struct vring_ipi_info *ipi = intr->data;
+
+       (void) vect_id;
+
        read(vect_id, dummy_buf, sizeof(dummy_buf));
        atomic_flag_clear(&ipi->sync);
        return 0;
 }
 
-static int _enable_interrupt(struct proc_vring *vring_hw)
+static int _enable_interrupt(struct proc_intr *intr)
 {
-       struct vring_ipi_info *ipi = vring_hw->intr_info.data;
+       struct vring_ipi_info *ipi = intr->data;
 
        ipi->fd = event_open(ipi->path);
        if (ipi->fd < 0) {
@@ -187,11 +187,11 @@ static int _enable_interrupt(struct proc_vring *vring_hw)
                return -1;
        }
 
-       vring_hw->intr_info.vect_id = ipi->fd;
+       intr->vect_id = ipi->fd;
 
        /* Register ISR */
        metal_irq_register(ipi->fd, _ipi_handler,
-                               NULL, vring_hw);
+                               NULL, intr);
        return 0;
 }
 
index 06a07791ce3b31e5dd34d9364f80c8b539763f74..7a873d882748c5d682e0dcdca6e9fb599cfb2b1a 100644 (file)
@@ -82,7 +82,7 @@
 #define _rproc_wait() asm volatile("wfi")
 
 /*--------------------------- Declare Functions ------------------------ */
-static int _enable_interrupt(struct proc_vring *vring_hw);
+static int _enable_interrupt(struct proc_intr *intr);
 static void _notify(struct hil_proc *proc, struct proc_intr *intr_info);
 static int _boot_cpu(struct hil_proc *proc, unsigned int load_addr);
 static void _shutdown_cpu(struct hil_proc *proc);
@@ -118,26 +118,25 @@ static struct metal_io_region gic_dist_io = {
 
 int _ipi_handler(int vect_id, void *data)
 {
+       struct proc_intr *intr_info = data;
+
        (void) vect_id;
-       struct proc_vring *vring_hw = (struct proc_vring *)(data);
-       struct proc_intr *intr_info;
 
-       intr_info = &(vring_hw->intr_info);
        atomic_flag_clear((atomic_uint *)&(intr_info->data));
 
        //ipi_counter++;
        return 0;
 }
 
-static int _enable_interrupt(struct proc_vring *vring_hw)
+static int _enable_interrupt(struct proc_intr *intr)
 {
        //enableirq_counter++;
        /* Register ISR */
-       metal_irq_register(vring_hw->intr_info.vect_id, _ipi_handler,
-                               vring_hw->intr_info.dev, vring_hw);
+       metal_irq_register(intr->vect_id, _ipi_handler,
+                       intr->dev, intr);
 
        /* Enable the interrupts */
-       metal_irq_enable(vring_hw->intr_info.vect_id);
+       metal_irq_enable(intr->vect_id);
 
        return 0;
 }
index 52823d69013c0077ef12b2bc4b4551af04bea205..6aaf744f6ffad0e1294bd9b56804d5886ff6daed 100644 (file)
@@ -74,7 +74,7 @@ struct ipi_info {
 };
 
 /*--------------------------- Declare Functions ------------------------ */
-static int _enable_interrupt(struct proc_vring *vring_hw);
+static int _enable_interrupt(struct proc_intr *intr);
 static void _notify(struct hil_proc *proc, struct proc_intr *intr_info);
 static int _boot_cpu(struct hil_proc *proc, unsigned int load_addr);
 static void _shutdown_cpu(struct hil_proc *proc);
@@ -97,13 +97,14 @@ struct hil_platform_ops zynqmp_r5_a53_proc_ops = {
 
 int _ipi_handler(int vect_id, void *data)
 {
-       (void) vect_id;
-       struct proc_vring *vring_hw = (struct proc_vring *)(data);
-       struct ipi_info *ipi =
-               (struct ipi_info *)(vring_hw->intr_info.data);
+       struct proc_intr *intr = data;
+       struct ipi_info *ipi = intr->data;
        struct metal_io_region *io = ipi->io;
        unsigned int ipi_intr_status =
            (unsigned int)metal_io_read32(io, IPI_ISR_OFFSET);
+
+       (void) vect_id;
+
        if (ipi_intr_status & ipi->ipi_chn_mask) {
                atomic_flag_clear(&ipi->sync);
                metal_io_write32(io, IPI_ISR_OFFSET,
@@ -113,10 +114,10 @@ int _ipi_handler(int vect_id, void *data)
        return -1;
 }
 
-static int _enable_interrupt(struct proc_vring *vring_hw)
+static int _enable_interrupt(struct proc_intr *intr)
 {
        struct ipi_info *ipi =
-           (struct ipi_info *)(vring_hw->intr_info.data);
+           (struct ipi_info *)(intr->data);
        struct metal_io_region *io = ipi->io;
 
        if (!ipi->need_reg) {
@@ -124,10 +125,10 @@ static int _enable_interrupt(struct proc_vring *vring_hw)
        }
 
        /* Register ISR */
-       metal_irq_register(vring_hw->intr_info.vect_id, _ipi_handler,
-                               vring_hw->intr_info.dev, vring_hw);
+       metal_irq_register(intr->vect_id, _ipi_handler,
+                               intr->dev, intr);
        /* Enable IPI interrupt */
-       metal_irq_enable(vring_hw->intr_info.vect_id);
+       metal_irq_enable(intr->vect_id);
        metal_io_write32(io, IPI_IER_OFFSET, ipi->ipi_chn_mask);
        return 0;
 }
index d93cffab088a7bdf5d3fb350856bafaf14778bb0..9ba49c3e720791f28bd69ff400f364d284581c3a 100644 (file)
@@ -78,7 +78,7 @@ struct ipi_info {
 };
 
 /*--------------------------- Declare Functions ------------------------ */
-static int _enable_interrupt(struct proc_vring *vring_hw);
+static int _enable_interrupt(struct proc_intr *intr);
 static void _notify(struct hil_proc *proc, struct proc_intr *intr_info);
 static int _boot_cpu(struct hil_proc *proc, unsigned int load_addr);
 static void _shutdown_cpu(struct hil_proc *proc);
@@ -97,9 +97,9 @@ struct hil_platform_ops zynqmp_a53_r5_proc_ops = {
        .release    = _release,
 };
 
-static int _enable_interrupt(struct proc_vring *vring_hw)
+static int _enable_interrupt(struct proc_intr *intr)
 {
-       (void)vring_hw;
+       (void)intr;
        return 0;
 }