文章目录
VIC domain 与 gpio domain 的硬件拓扑语言描述 VIC 与 INT_EINTx 的关系 INT_EINTx 与 GPIO的关系 INT_EINT0 INT_EINT1 INT_EINT2 INT_EINT3 INT_EINT4 INT_EINT4 与 External interrupt Group1-9 的关系 External interrupt Group1 External interrupt Group2 External interrupt Group3 External interrupt Group4 External interrupt Group5 External interrupt Group6 External interrupt Group7 External interrupt Group8 External interrupt Group9
VIC domain 与 gpio domain 的硬件拓扑图描述 linux cascaded irq domain
VIC domain 与 gpio domain 的硬件拓扑语言描述
VIC 与 INT_EINTx 的关系
Int. No. Sources Description Group 53 INT_EINT4 External interrupt Group 1 ~ Group 9 VIC1 33 INT_EINT3 External interrupt Group 0 20 ~ 27 VIC1 32 INT_EINT2 External interrupt Group 0 12 ~ 19 VIC1 1 INT_EINT1 External interrupt Group 0 4 ~ 11 VIC0 0 INT_EINT0 External interrupt Group 0 0 ~ 3 VIC0
INT_EINTx 与 GPIO的关系
INT_EINT0
External interrupt Group 0 0 - 15 <= == > GPN0- GPN15
GPN0- 3 : 0
GPN4- 11 : 1
GPN12- 15 & GPL8- GPL11 : 32
External interrupt Group 0 16 - 22 <= == > GPL8- GPL14
GPL12- GPL14 & GPM0- GPM4 : 33
External interrupt Group 0 23 - 27 <= == > GPM0- GPM4
INT_EINT1
External interrupt Group 0 0 - 15 <= == > GPN0- GPN15
External interrupt Group 0 16 - 22 <= == > GPL8- GPL14
External interrupt Group 0 23 - 27 <= == > GPM0- GPM4
INT_EINT2
External interrupt Group 0 0 - 15 <= == > GPN0- GPN15
External interrupt Group 0 16 - 22 <= == > GPL8- GPL14
External interrupt Group 0 23 - 27 <= == > GPM0- GPM4
INT_EINT3
External interrupt Group 0 0 - 15 <= == > GPN0- GPN15
External interrupt Group 0 16 - 22 <= == > GPL8- GPL14
External interrupt Group 0 23 - 27 <= == > GPM0- GPM4
INT_EINT4
INT_EINT4 与 External interrupt Group1-9 的关系
External interrupt Group1
EINT1 0 - 7 <= == > GPA 0 - 7
EINT1 8 - 14 <= == > GPB 0 - 6
External interrupt Group2
EINT2 0 - 7 <= == > GPC 0 - 7
External interrupt Group3
EINT3 0 - 4 <= == > GPD 0 - 4
External interrupt Group4
EINT4 0 - 13 <= == > GPF 0 - 13
External interrupt Group5
EINT5 0 - 6 <= == > GPG 0 - 6
External interrupt Group6
EINT6 0 - 9 <= == > GPH 0 - 9
External interrupt Group7
EINT7 0 - 15 <= == > GPO 0 - 7
External interrupt Group8
EINT8 0 - 14 <= == > GPP 0 - 7
External interrupt Group9
EINT9 0 - 8 <= == > GPQ 0 - 8
VIC domain 与 gpio domain 的硬件拓扑图描述
以下是 s3c6410a 的 irq domain 描述, 着重凸显了 gpio irq domain
以下 每个颜色 是一个irq domain , 共 8 个irq domain
linux cascaded irq domain
irq domain & 级联(cascaded)irq domain
if ( parent_irq) {
irq_set_chained_handler ( parent_irq, gpio_handle_irq_cascaded, v) ;
}
一旦发生硬件中断,经过CPU architecture相关的中断代码之后,会调用irq handler,该函数的一般过程如下:
(1 )首先找到root interrupt controller对应的irq domain。
(2 )根据HW 寄存器信息和irq domain信息获取HW interrupt ID
(3 )调用irq_find_mapping找到HW interrupt ID对应的irq number
(4 )调用handle_IRQ(对于ARM平台)来处理该irq number
按照当前 gpio 级联到 vic
假设 vic0 是 A, GPN0- 3 的domain 是 B
假设 GPN0 发生了中断
A. 1 首先找到root interrupt controller ( 在这里是vic) 对应的irq domain
A. 2 根据VIC HW 寄存器信息和irq domain信息获取HW interrupt ID
A. 3 调用irq_find_mapping找到HW interrupt ID ( 在这里是0 ) 对应的irq number
A. 4 调用irq domain B 注册 的 handler ( irq_set_chained_handler 设定的gpio_handle_irq_cascaded)
B. 1 gpio_handle_irq_cascaded找到gpio对应的irq domain
B. 2 根据GPIO HW 寄存器信息和irq domain信息获取HW interrupt ID
B. 3 调用irq_find_mapping找到HW interrupt ID对应的irq number
B. 4 调用 驱动 注册 的 handler ( request_irq 设定的)