rename and define some local var/funcs static
[processor-sdk/open-amp.git] / lib / remoteproc / drivers / zynqmp_remoteproc_a53.c
index 41fb19f4a08f557fd10e2d22cf41d76aa8b3b772..acfaa38a76f1440a6d3fe8c8712e2479b0cd2411 100644 (file)
@@ -87,9 +87,9 @@ void _ipi_handler(int vect_id, void *data)
        unsigned int ipi_base_addr = chn_ipi_info->ipi_base_addr;
        unsigned int ipi_intr_status =
            (unsigned int)HIL_MEM_READ32(ipi_base_addr + IPI_ISR_OFFSET);
        unsigned int ipi_base_addr = chn_ipi_info->ipi_base_addr;
        unsigned int ipi_intr_status =
            (unsigned int)HIL_MEM_READ32(ipi_base_addr + IPI_ISR_OFFSET);
-       if (ipi_intr_status && chn_ipi_info->ipi_chn_mask) {
+       if (ipi_intr_status & chn_ipi_info->ipi_chn_mask) {
                platform_dcache_all_flush();
                platform_dcache_all_flush();
-               hil_isr(vring_hw);
+               platform_isr(vect_id, data);
                HIL_MEM_WRITE32((ipi_base_addr + IPI_ISR_OFFSET),
                                chn_ipi_info->ipi_chn_mask);
        }
                HIL_MEM_WRITE32((ipi_base_addr + IPI_ISR_OFFSET),
                                chn_ipi_info->ipi_chn_mask);
        }
@@ -103,7 +103,7 @@ void _ipi_handler_deinit(int vect_id, void *data)
        unsigned int ipi_base_addr = chn_ipi_info->ipi_base_addr;
        unsigned int ipi_intr_status =
            (unsigned int)HIL_MEM_READ32(ipi_base_addr + IPI_ISR_OFFSET);
        unsigned int ipi_base_addr = chn_ipi_info->ipi_base_addr;
        unsigned int ipi_intr_status =
            (unsigned int)HIL_MEM_READ32(ipi_base_addr + IPI_ISR_OFFSET);
-       if (ipi_intr_status && chn_ipi_info->ipi_chn_mask) {
+       if (ipi_intr_status & chn_ipi_info->ipi_chn_mask) {
                HIL_MEM_WRITE32((ipi_base_addr + IPI_ISR_OFFSET),
                                chn_ipi_info->ipi_chn_mask);
        }
                HIL_MEM_WRITE32((ipi_base_addr + IPI_ISR_OFFSET),
                                chn_ipi_info->ipi_chn_mask);
        }
@@ -112,8 +112,13 @@ void _ipi_handler_deinit(int vect_id, void *data)
 
 static int _enable_interrupt(struct proc_vring *vring_hw)
 {
 
 static int _enable_interrupt(struct proc_vring *vring_hw)
 {
-       if (vring_hw->intr_info.vect_id == 0xFFFFFFFF)
+       struct ipi_info *chn_ipi_info =
+           (struct ipi_info *)(vring_hw->intr_info.data);
+       unsigned int ipi_base_addr = chn_ipi_info->ipi_base_addr;
+
+       if (vring_hw->intr_info.vect_id == 0xFFFFFFFF) {
                return 0;
                return 0;
+       }
 
        /* Register ISR */
        env_register_isr_shared(vring_hw->intr_info.vect_id,
 
        /* Register ISR */
        env_register_isr_shared(vring_hw->intr_info.vect_id,
@@ -122,11 +127,13 @@ static int _enable_interrupt(struct proc_vring *vring_hw)
        env_enable_interrupt(vring_hw->intr_info.vect_id,
                             vring_hw->intr_info.priority,
                             vring_hw->intr_info.trigger_type);
        env_enable_interrupt(vring_hw->intr_info.vect_id,
                             vring_hw->intr_info.priority,
                             vring_hw->intr_info.trigger_type);
+       HIL_MEM_WRITE32((ipi_base_addr + IPI_IER_OFFSET),
+               chn_ipi_info->ipi_chn_mask);
        return 0;
 }
 
 /* In case there is an interrupt received after deinit. */
        return 0;
 }
 
 /* In case there is an interrupt received after deinit. */
-void _reg_ipi_after_deinit(struct proc_vring *vring_hw)
+static void _reg_ipi_after_deinit(struct proc_vring *vring_hw)
 {
        struct ipi_info *chn_ipi_info =
            (struct ipi_info *)(vring_hw->intr_info.data);
 {
        struct ipi_info *chn_ipi_info =
            (struct ipi_info *)(vring_hw->intr_info.data);
@@ -141,7 +148,7 @@ void _reg_ipi_after_deinit(struct proc_vring *vring_hw)
                     "remoteproc_a53", 1);
 }
 
                     "remoteproc_a53", 1);
 }
 
-void _notify(int cpu_id, struct proc_intr *intr_info)
+static void _notify(int cpu_id, struct proc_intr *intr_info)
 {
 
        (void)cpu_id;
 {
 
        (void)cpu_id;
@@ -155,14 +162,14 @@ void _notify(int cpu_id, struct proc_intr *intr_info)
                        chn_ipi_info->ipi_chn_mask);
 }
 
                        chn_ipi_info->ipi_chn_mask);
 }
 
-int _boot_cpu(int cpu_id, unsigned int load_addr)
+static int _boot_cpu(int cpu_id, unsigned int load_addr)
 {
        (void)cpu_id;
        (void)load_addr;
        return -1;
 }
 
 {
        (void)cpu_id;
        (void)load_addr;
        return -1;
 }
 
-void _shutdown_cpu(int cpu_id)
+static void _shutdown_cpu(int cpu_id)
 {
        (void)cpu_id;
        return;
 {
        (void)cpu_id;
        return;