Commit Graph

7 Commits

Author SHA1 Message Date
Joseph Chen a1b32c2412 irq: clean up code
remove unused code and fix compile warning.

Change-Id: I912eff25bf60da925791b889f08e91d4fcb61893
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen ed837edf98 irq: support irq suspend and resume
U-Boot will support cpu suspend/resume, cpu and logic may
lose power, this patch guarantees gic works normally.

Change-Id: I8ebee881fa27fea075502f962f9faabaa8264f67
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-05 09:34:48 +08:00
Joseph Chen 5db1153e4b drivers: irq: support convert gpio to irq by gpio fdt phandle
add funtion: phandle_gpio_to_irq(u32 gpio_phandle, u32 pin)

Change-Id: Iec2d1ed08138c2476bb13deb16ca06960fadd60d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-23 09:28:07 +08:00
Joseph Chen 0e508c4fef drivers: irq: disable irq before free irq handler
It makes irq handler free safely

Change-Id: Id3af8956d5681881301e658a1adb9ca3aba97f79
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-23 09:27:58 +08:00
Joseph Chen 42865eb5ad drivers: irq: deliver both irq and private data to irq handler
gic irq handler only need private data, while gpio irq(parent bank)
handler needs private data and irq number for getting gpio bank and
pin information. So we need deliver both of them to the irq handler.

This patch fixes the legacy code issue.

Change-Id: I1917b588a867e807cbd15e2e4101ae259cf4a40f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-12 09:41:08 +08:00
Joseph Chen dbcd148475 drivers: irq: malloc a temporary string for strtok
strtok will update original input string.

Change-Id: I9c81a72045f057c8a7d17f688e2d9f70dd849880
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-12 09:41:08 +08:00
Joseph Chen 4e6670fe63 drivers: add irq interrupt framework support
This patch add support for IRQ interrupt, FIQ not included.
It will be enabled when you select CONFIG_GICV2 or CONFIG_GICV3.

The framework support gic interrupt and gpio interrupt, relative APIs
are provided in: ./include/irq-platform.h

If you'd like to add a new platform support into interrupt framework,
please follow the steps:
1. add relative definitions in the file like other platforms:
   	./include/irq-platform.h

2. add GICD, GICC and GICR(for GICV3) base address definitions in the
   rkxxx-common.h, they are needed in: arch/arm/cpu/armv8/start.S;

3. enable CONFIG_GICV2 or CONFIG_GICV3.

Notice:
1. the framework is initialize in function 'interrupt_init()' of
   _sequence_r[]. So you should not request irqs too early.

2. IRQ stack size is configured by CONFIG_IRQ_STACK_SIZE, the default
   value is 8KB when CONFIG_IRQ_STACK_SIZE is absent.

Change-Id: I3d9e29873c9d64cd28aabd13a61111438c5902b0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-09-27 10:34:17 +08:00