淺析開發板相關變量phys_io即EP93XX_APB_PHYS_BASE什麼時候被引用

文件:arch/arm/kernel/head.S
// cpu執行入口
    .section ".text.head", "ax"
ENTRY(stext)
    msr    cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
                        @ and irqs disabled
    mrc    p15, 0, r9, c0, c0        @ get processor id
    bl    __lookup_processor_type        @ r5=procinfo r9=cpuid
    movs    r10, r5                @ invalid processor (r5=0)?
    beq    __error_p            @ yes, error 'p'
    bl    __lookup_machine_type        @ r5=machinfo
    movs    r8, r5                @ invalid machine (r5=0)?
    beq    __error_a            @ yes, error 'a'
    bl    __vet_atags
    bl    __create_page_tables        // 建立映射表

文件:arch/arm/kernel/asm-offsets.c
DEFINE(MACHINFO_PHYSIO,    offsetof(struct machine_desc, phys_io));

文件:arch/arm/kernel/head.S
__create_page_tables:
#ifdef CONFIG_DEBUG_LL              // 只有配置CONFIG_DEBUG_LL之後
    ......
    ldr    r3, [r8, #MACHINFO_PHYSIO]  // 纔會爲EP93XX_APB_PHYS_BASE物理寄存器建立MMU映射[luther.gliethttp]
    ......                          // 一般我們都不會去配置CONFIG_DEBUG_LL,而是在ep93xx_map_io中由我們自己建立io寄存器映射
#endif


MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
    /* Maintainer: Toufeeq Hussain <[email protected]> */
    .phys_io    = EP93XX_APB_PHYS_BASE,[luther.gliethttp]
    .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
    .boot_params    = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
    .map_io        = ep93xx_map_io,
    .init_irq    = ep93xx_init_irq,
    .timer        = &ep93xx_timer,
    .init_machine    = edb9312_init_machine,[luther.gliethttp]
MACHINE_END

文章出處:http://blog.chinaunix.net/u1/38994/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章