Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* How to use enable the FIQ with the ARM timer on rpi zero in my driver?
@ 2020-04-13  9:11 s.achterop
  2020-04-13  9:37 ` s.achterop
  0 siblings, 1 reply; 2+ messages in thread
From: s.achterop @ 2020-04-13  9:11 UTC (permalink / raw)
  To: kernelnewbies

   Hello List,
I am on a raspberry pi zero, chipset BCM2835, and try to use the ARM timer to get FIQ interrupts.
I compiled the kernel from source to be able to create my out-of-tree module. Uname -a gives:
     Linux raspberrypi 4.19.108+ #1 PREEMPT Tue Mar 31 10:00:18 CEST 2020 armv6l GNU/Linux
       (i only set it to be a low-latency-kernel)

I try to create an fiq interrupt in a number of ways, but nothing works.
The driver I created can be found at
     https://github.com/SietseAchterop/Batradio/blob/master/batradio_module/fiqtest.c

The ARM timer is configured by directly writing to the registers.
It is running fine and sets it's interrupt bit at some point.
So I assume that linux does not use the ARM timer in a base configuration.

When using:

  ret = claim_fiq(&bat_fh);
  set_fiq_handler(&batradio_handler, &batradio_handler_end - &batradio_handler);
  set_fiq_regs(&regs);
  enable_fiq(x);

There are no fiq interrupts, i tried several values of x.
My main question is, which irq number should I use.

Note that I use
     pdev = platform_device_register_simple("batradio__", 0, NULL, 0);
to register this platform device.

I did find a complete example in
    https://bootlin.com/blog/fiq-handlers-in-the-arm-linux-kernel/
But there they used a device tree and got the fiq-irq number via the probe function argument.
Maybe that is a way to get it working, but I don't know with compatible value to use.

I also tried, instead of enable_fiq, to directly connect the ARM timer to FIQ by
writing 0xC0, 0x80 + 0x40, to the FIQ Control register 0x20C.
But then Linux freezes immediately, so that's probably the wrong way.

What could I do to get FIQ interrupts working? Or where can I find which irq number to use in enable_fiq?

    Hopefully someone can point me in a direction.
       Thanks in advance,
           Sietse


PS. I forced dwc_otg to not use fiq by adding the following to /boot/cmdline.txt
         dwc_otg.fiq_fsm_enable=0 dwc_otg.fiq_enable=0 dwc_otg.nak_holdoff=0

     I also make it boot up with console, so no X stuff, and access via ssh.


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to use enable the FIQ with the ARM timer on rpi zero in my driver?
  2020-04-13  9:11 How to use enable the FIQ with the ARM timer on rpi zero in my driver? s.achterop
@ 2020-04-13  9:37 ` s.achterop
  0 siblings, 0 replies; 2+ messages in thread
From: s.achterop @ 2020-04-13  9:37 UTC (permalink / raw)
  To: kernelnewbies


> When using:
> 
>   ret = claim_fiq(&bat_fh);
>   set_fiq_handler(&batradio_handler, &batradio_handler_end - &batradio_handler);
>   set_fiq_regs(&regs);
>   enable_fiq(x);
> 

 From driver/irqchip/irq-bcm2835.c I infer that I probably will need to use the devicetree somehow,
But what compatible string should I use when creating the driver.
I tried several things and really am at a loss here,

    thanks in advance,
       Sietse



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13  9:11 How to use enable the FIQ with the ARM timer on rpi zero in my driver? s.achterop
2020-04-13  9:37 ` s.achterop

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git