Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5067

Bare metal, Assembly language • Re: ARM timer (sp804) interrupts on Pi4

$
0
0
Hello

I am new to Linux. I am using RPI4 Model B board. I am trying to write a driver which handles the ARM timer interrupt which describer in chapter 12 of spec(https://datasheets.raspberrypi.com/bcm2 ... herals.pdf).

-> I have created an Linux image using buildroot and it up and running.
-> I can see by default GIC is enabled.
-> Arm Timer interrupt connect to pin 64 to GIC (shown in diagram at page number 89 of the spec. section (6.3. GIC-400 interrupt controller).
-> I am able to map the timer register in my driver.
-> when I try to call request_irq(64, irq_handler, irq_flag, ....); Its succeed but somehow my registered interrupt handler is not getting called.

Is it right to call request_irq with irq number 64 ?
I don't see any node for ARM Timer in device tree too.

Below is the code snippet --

#define AT_GIC_IRQ (64)

addr = ioremap(0xFE00B400, 0x1000);
if(addr == NULL) {
printk(KERN_ERR "Failed in ioremap");
goto r_sysfs;
}

ret = request_irq(AT_GIC_IRQ, irq_handler,IRQF_SHARED,"etx_device", (void *)(irq_handler));
if(ret) {
printk(KERN_ERR "my_device: cannot register IRQ %d\n ", ret);
goto irq;
}
printk(KERN_INFO "my_device:register IRQ %d\n", ret);
How fast do you want your timer interrupts to fire? Is your linux real time or not? You may want to put it on the FIQ instead of the USB (dwc_otg.fiq_fsm_enable=0 dwc_otg.fiq_enable=0 in this order in the cmdline.txt). IRQs may not be serviced very fast if kernel is already servicing one or executing a critical code section.

Statistics: Posted by MaximBondaruk — Fri Mar 29, 2024 7:06 pm



Viewing all articles
Browse latest Browse all 5067

Trending Articles