gliethttpgliethttp.blog.chinaunix.net
gliethttp
全部博文(2005)
2014年(2)
2013年(2)
2012年(16)
2011年(66)
2010年(368)
2009年(743)
2008年(491)
2007年(317)
linux_zj
程睿
mzh2100
dogsun88
叶绍琛
kowems
gongping
chumojin
高泽然
xy7777
os123456
hiderhao
zahassio
byy6by
zxy11861
COVID_19
a1960048
swzswz
分类: LINUX
2007-08-08 15:40:20
浅析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] = i; AT91_SYS->AIC_SMR[i] = at91rm9200_irq_smr[i]; irq_desc[i].valid = 1; irq_desc[i].mask_ack = at91rm9200_mask_irq; irq_desc[i].mask = at91rm9200_mask_irq; irq_desc[i].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;//至此中断所需要的硬性寄存器环境已经完成}
上一篇:浅析armlinux-set_ach()->request_standard_resource函数6
下一篇:浅析armlinux-setup_arch()->setup_arch()函数-最终
登录 注册