This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to register IPC interrupt ISR function on TCI6638EVM kernel?

Other Parts Discussed in Thread: TCI6638K2K

Hi,all:

Now, I am working with TCI6638K2K EVM.Kernel is download from :

git clone git://arago-project.org/git/projects/linux-keystone.git

I am researching the source code in irq-keystone-ipc.c

(tci6638-linux-kernel\linux-keystone\drivers\irqchip) to learn how ARM a15 register IPC interrupt ISR function in kernel.But There are some questions which are puzzled me.

As well known,When ARM want to register interrupt ISR in kernel,The usually operation is to use request_irq below.The only thing we need to do is that we provide the irq number and interrupt ISR function for handler.But in the irq-keystone-ipc.c it seems not like this.

int request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long frags, const char *device, void *dev_id);

 

In the keystone_ipc_irq_of_init, I see that kernel register ipc interrupt ISR function using

kipc->chip.irq_ack    = keystone_ipc_ack_irq, I also see that keystone_ipc_ack_irq can be called when DSP side set the register IPCGR_8. That means that ARM go into the IPC interrupt ISR function and receive the interrupt request from DSP.

 

kipc->mask = ~0x0;

kipc->chip.name                = "keystone-ipc-irq";

kipc->chip.irq_ack    = keystone_ipc_ack_irq;

kipc->chip.irq_mask         = keystone_ipc_mask_irq;

kipc->chip.irq_unmask     = keystone_ipc_unmask_irq;

 

Since I am not very skilled in linux kernel programming

1.

So I want to ask why kernel don’t use request_irq  register interrupt ISR function like the way which I know.

2.

Isn’t it the only way that we register interrupt ISR function into kernel using request_irq?

3.

Can you explain the method with which tci6638k2k kernel register the IPC interrupt ISR function?

Thanks very much!

 

  • Hi, Toure,

    In Keystone-II, there is a Generic Interrupt Controller, and the code you looked at is to configure that controller. If you look at TI's implementation of remoteproc which uses IPC, in drivers/remoteproc/remoteproc_user.c, it still calls request_irq() to register.

    Rex

  • Hi,Rex:

    I don't know what's the relationship between remoteproc_user.c and irq-keystone-ipc.c.

    I think irq-keystone-ipc.c is the one what I indeed need and I don't use remoteproc_user.c

    I have verify that I can enter IPC ack ISR(kipc->chip.irq_ack    = keystone_ipc_ack_irq).

    I think that is enough and that  can meet my need.I don't look into remoteproc_user.c

    What I am confused is that it seems not using request_irq function to register keystone_ipc_ack_irq?

    So,I think it's a special one.

  • Hi, Toure,

    You misunderstood what I said. I asked you to take remoteproc as an example which calls request_irq to register the irq handler. TI implemented this remoteproc driver and still uses request_irq for IPC interrupt handling. Touching code in irqchip is considered hacking the kernel which you definitely can do, but that makes your code not portable.

    Rex

  • Hi,Rex chang:

    May I understand your meaning like that you don't recommend me to research

    how the kernel register ipc interrupt ISR function keystone_ipc_ack_irq?

    I just want to learn in the common situation how kernel register the interrupt ISR function.

    When I google,someone said that you must use request_irq to register ISR.But When I

    read keystone2 kernel source code,I cannot see kernel use request_irq to register ISR

    keystone_ipc_ack_irq.So,That's my confused place.

  • Kernel driver should use request_irq to register ISR. The irqchip is specific to TI Keystone-2 hardware which provides an abstraction layer so kernel drivers can be hardware independent and generic to other platforms.

    Rex