0

I'm developping a simple GPIO driver for a SoC running linux (newbie's level), I am facing problem because IRQ numbers are different from those in datasheets.

I've learned that effective IRQ manager may create IRQ domains. However the

unsigned int irq_find_mapping(struct irq_domain *domain, irq_hw_number_t hwirq) needs a domain structure. How can I list the available domain for my plateform. Thank you.

here are some files' content

file: irq_domain_mapping
name mapped linear-max direct-max devtree_node gpio-dwapb 29 29 0 /soc/gpio@ff709000/gpio-controller ... 99 0x00019 none
file : /proc/interrupts
99 ... 25 edge gpiolib
however DTS file maps the interruption at 197 with dwapb manager
interrupts = <0x00000000 0x000000a5 0x00000004>

SOFuser
  • 134
  • 1
  • 10
  • `cat /sys/kernel/debug/irq_domain_mapping`. Be sure you have *CONFIG_IRQ_DOMAIN_DEBUG=y* in the kernel configuration. – 0andriy Dec 13 '17 at 17:08
  • I've edited my question, the interruption is mapped to 197 in DTS file but is set to 99 in linux – SOFuser Dec 14 '17 at 09:41
  • It would be better if you gather all 3 files (/proc/interrupts, irq_domain_mapping and DTS with code in question) on some internet share (pastebin like) w/ **full** contents. – 0andriy Dec 15 '17 at 23:09

1 Answers1

0

There are many things to consider:

  1. /proc/interrupts will give IRQ number you can use that directly.
  2. BSP documentation mentions IRQ assigned/used by drivers.
  3. See kernel code /arch/arm/your-platform files, you will see IRQ Numbers assigned.
  4. Device tree file is the best option for identifying the IRQ number.
Hercules dd
  • 215
  • 1
  • 5