浅析armlinux-setup_arch()->init_arch_irq()函数7
文章来源:http://gliethttp.cublog.cn
建议首先参考《浅析armlinux2_4_19启动程式[head-armv.s文档]》[http://gliethttp.cublog.cn]
函数指针init_arch_irq在setup_arch()函数的末尾被赋值,init_arch_irq = mdesc->init_irq;
我的平台是at91rm9200,所以mdesc->init_irq位于arch/arm/mach-at91rm9200/Core.c中--at91rm9200_init_irq,
//++++++++++++++
//arch/arm/mach-at91rm9200/Core.c
//位于.arch.info段
//MACHINE_START(AT91RM9200, "ATMEL AT91RM9200")//.nr = MACH_TYPE_##_type=MACH_TYPE_AT91RM9200=251
//和上面从u-boot传到r1中的相同[gliethttp]
//MAINTAINER("SAN People / ATMEL")
//BOOT_MEM(AT91_SDRAM_BASE, AT91C_BASE_SYS, AT91C_VA_BASE_SYS)
//BOOT_PARAMS(AT91_SDRAM_BASE + 0x100)//tag list存放的物理地址0x20000100[gliethttp]
//FIXUP(at91rm9200_fixup)
//MAPIO(at91rm9200_map_io)
//INITIRQ(at91rm9200_init_irq)
//MACHINE_END[gliethttp]
//--------------
void __init at91rm9200_init_irq(void)
{
unsigned int i;
//对已虚拟映射的at91rm9200的寄存器进行读写
for (i = 0; i NR_IRQS; i++) {
AT91_SYS->AIC_SVR = i;
AT91_SYS->AIC_SMR = at91rm9200_irq_smr;
irq_desc.valid = 1;
irq_desc.mask_ack = at91rm9200_mask_irq;
irq_desc.mask = at91rm9200_mask_irq;
irq_desc.unmask = at91rm9200_unmask_irq;
if (i 8)
AT91_SYS->AIC_EOICR = AT91_SYS->AIC_EOICR;//必须要有,否则中断不能工作
//以上都是对at91rm9200寄存器的启动操作,很简单,没什么可说的
}
AT91_SYS->AIC_SPU = NR_IRQS;
/* No debugging in AIC: Debug (Protect) Control Register */
AT91_SYS->AIC_DCR = 0;
/* Disable and clear all interrupts initially */
AT91_SYS->AIC_IDCR = 0xFFFFFFFF;
AT91_SYS->AIC_ICCR = 0xFFFFFFFF;
//至此中断所需要的硬性寄存器环境已完成
}
阅读(629) | 评论(0) | 转发(0) |