AnsweredAssumed Answered

IMX8mq: core can't receive ipi interrupts.

Question asked by 书意 程 on Aug 9, 2019
Latest reply on Aug 9, 2019 by 书意 程

Hi,

   I am working on hypervisor on imx8mq-evk platform. I send an ipi but core doesn't recevice it. Below is my code.

 

static void gicv3_send_sgi_list(uint32_t sgi, cpumask_t *mask)
{
        int cpu;
        uint64_t val;
        int list_cluster0 = 0;
        int list_cluster1 = 0;
        uint32_t val_32;

        for_each_cpu (cpu, mask) {
                if (cpu >= CONFIG_NR_CPUS_CLUSTER0)
                        list_cluster1 |= 1 << (cpu - CONFIG_NR_CPUS_CLUSTER0);
                else
                        list_cluster0 |= (1 << cpu);
        }

        /*
         * TBD: now only support two cluster
         */
        if (list_cluster0) {
                val = list_cluster0 | (0ul << 16) | (0ul << 32) | (0ul << 48) |
                 (sgi << 24);
                write_sysreg64(val, ICC_SGI1R_EL1);
        }

        if (list_cluster1) {
                val = list_cluster1 | (1ul << 16) | (0ul << 32) | (0ul << 48) |
                 (sgi << 24);
                write_sysreg64(val, ICC_SGI1R_EL1);
        }

        if (iomuxc_gpr_base) {
                /* pending the IRQ32 to wakeup the core */
                val_32 = readl_relaxed(iomuxc_gpr_base + 0x4);
                val_32 |= (1 << 12);
                writel_relaxed(val_32, iomuxc_gpr_base + 0x4);
                /* delay for a while to make sure cores wakeup done */
                udelay(50);
                val_32 &= ~(1 << 12);
                writel_relaxed(val_32, iomuxc_gpr_base + 0x4);
        }
        isb();
}

 

 

References: 

1. https://www.nxp.com/docs/en/errata/IMX8MDQLQ_0N14W.pdf 

2. irq-gic-v3.c\irqchip\drivers - linux-imx - i.MX Linux kernel 

 

Thanks for any advice!

Outcomes