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.

66AK2H14: IPCGR8 interrupt number in Linux

Part Number: 66AK2H14

I have a kernel module where in I want ro request an irq to get notified when the IPC generation register ipcgr8 fires.

On the driver I call platform_get_irq(pdev, 0) but from reading 66AK2H14 I don't understand what interrupt number I shall I use on my dts 

In my dts I have written for my device following entries:

		my_device {
			compatible = "linux, my_driver";
			
			interrupt-parent = <&gic>;
			interrupts = <GIC_SPI ? ? >;
			interrupt-names = "ipcgr8";
			
		};

Whenever I set bit 0 of  ipcgr8 then, I see that kirq0 interrupt controller increase its counter.

  • Hi Isidro,

    Can you describe your usecase a bit more? Looking at the data manual (SPRS866G) and device-tree for K2H, IPC_GR8 system event goes to GIC interrupt number 4. Interrupts to this are handled by kirq0 which is modeled as interrupt controller.

    The 8 DSPs on K2HK are attached to this interrupt controller, and which of these DSPs caused the interrupt is de-multiplexed through reading register at address 0x026202A0 "IPC Acknowledgment Register for ARM CorePac0" by driver at drivers/irqchip/irq-keystone.c. 

    So, I think this interrupt is for use for kernel to handle DSP to ARM IPC. Can you clarify why you want some other driver to take control of this interrupt?

    			kirq0: keystone_irq@2a0 {
    				compatible = "ti,keystone-irq";
    				reg = <0x2a0 0x4>;
    				interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
    				interrupt-controller;
    				#interrupt-cells = <1>;
    				ti,syscon-dev = <&devctrl 0x2a0>;
    			};


  • Hello Sekhar,

    I want my kernel module to get notified when a DSP writes to ipcgr8  register, that at address 0x02620260. I thought by using platform_get_irq(pdev, 0) then, I could register a callback handler for the received irq and execute my driver activities. 

    Yes I have the kirq0 in place, its working OK and  I see that when I set on bit 0 at  0x02620260 then, kirq0 interrupt increase its counter by one.

    Following 8 DSP configuration in dts then I added my module to kirq0 as such

    my_device {
    			compatible = "linux, my_driver";
    			
    			interrupt-parent = <&kirq0>;
    			interrupts = <8 4>;
    			interrupt-names = "ipcgr8";
    		};

    and my kernel driver has been granted irq no 136. When I set on bit 0 at  0x02620260 then my driver's  irq handler is not called unless I also set on bits [15:12] on ipcgr8 register.







  • Hi

    kirq0: keystone_irq@2a0 {
              compatible = "ti,keystone-irq";

    The kirq0 working as IRQ de-multiplexer and it considers every bit in IPCAR8 as separate IRQ source (28 total). So,  for kirq0 IRQ 8 to work (and handler to trigger) the corresponding bit in ipcgr8 need to be set which fill reflect to IPCAR8.

    IPCGR8.bit12=1 + IPCGR8.bit0=1 --> IPCAR8.bit12 -> kirq0.irq8 -> handler.

    Note. Visible Linux IRQ number allocated and assigned dynamically.

  • Hi Isidro,

    If the goal is to establish DSP to ARM communication, you have considered using standard IPC interfaces instead? 

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_IPC.html#ipc-for-k2x

    standardized mechanisms like rpmgs have ability to have an in-kernel client, see simple rpmsg client driver documented here: https://www.kernel.org/doc/html/latest/staging/rpmsg.html#typical-usage

    Thanks,

    Sekhar