Dear Carlos,
Thank you for the reference.
I looked into some of the discussions. Specially this thread:
https://community.nxp.com/thread/303144
From this discussion it seems, it is possible to set CPU affinity for GPIO
interrupt on IMX6 board.
Is this true for IMX7DL boards also ? Because I have only IMX7 board.
Actually I don't have lot of time to go through every thread and gather the
important point for my implementation.
I need to provide quick update to our customer, which will help them to
decide about which board to choose.
Can you summarize all the post for me here, about what are the steps
required to set CPU affinity for a particular GPIO IRQ.
I think it will be a good reference for all others as well.
My requirement on IMX7DL Sabre is as follows:
- I want to set CPU affinity for FUNC2 button, which is mapped to GPIO138,
that is: GPIO5_IO10 on IMX7 board.
-> This is getting mapped to IRQ;172
-> Is it possible to set affinity for this IRQ number: 172 ?
- Similarly, I want to set affinity for GPIO2_21 to CPU:2 . Is it possible ?
For IRQ: 172, I am doing this from my driver, but it did not work.
#define IOMUXC_SW_MUX_CTL_PAD_SD2_WP 0x303301B0
#define IOMUXC_SW_PAD_CTL_PAD_SD2_WP 0x30330420
static unsigned int gpiono = 138;
u32 * iomuxc_sdp2_wp_pad_ctrl = ioremap(IOMUXC_SW_PAD_CTL_PAD_SD2_WP,4);
u32 * iomuxc_sdp2_wp_mux_ctrl = ioremap(IOMUXC_SW_MUX_CTL_PAD_SD2_WP,4);
iowrite32(0x05,iomuxc_sdp2_wp_mux_ctrl);
iowrite32(0x7c,iomuxc_sdp2_wp_pad_ctrl);
gpio_request(gpiono, "usr-button-func2");
gpio_direction_input(gpiono);
gpio_set_debounce(gpiono, 200);
gpio_export(gpiono, false);
irqno = gpio_to_irq(gpiono);
ret = request_irq(irqno, (irq_handler_t) usr_button_irq_handler,
IRQF_TRIGGER_RISING, "usr_button_irq_handler",
NULL);
cpu=1;
irq_set_affinity_hint(irqno, get_cpu_mask(cpu));
I also tried from user space, but did not work for me.
This is the output from dmesg: