u-boot-2014.10移植第12天----深入分析代碼(七),uboot2014.10移植

來源:互聯網
上載者:User

u-boot-2014.10移植第12天----深入分析代碼(七),uboot2014.10移植

c_runtime_cpu_setup函數在arch/arm/cpu/arm920t/start.S檔案中:

    .globl  c_runtime_cpu_setup
c_runtime_cpu_setup:
  mov pc, lr //沒做什麼就返回了

回到arch/arm/lib/crt0.S檔案中:

bl  c_runtime_cpu_setup /* we still call old routine here */

//bss段清零
    ldr r0, =__bss_start    /* this is auto-relocated! */
    ldr r1, =__bss_end      /* this is auto-relocated! */


    mov r2, #0x00000000     /* prepare zero to clear BSS */


clbss_l:cmp r0, r1          /* while not at end of BSS */
    strlo   r2, [r0]        /* clear 32-bit BSS word */
    addlo   r0, r0, #4      /* move to next */
    blo clbss_l


    bl coloured_LED_init

//coloured_LED_init函數在檔案common/board_f.c中

/*
 * sjg: IMO this code should be
 * refactored to a single function, something like:
 *  
 * void led_set_state(enum led_colour_t colour, int on);
 */ 
/************************************************************************
 * Coloured LED functionality
 ************************************************************************
 * May be supplied by boards if desired
 */ 
__weak void coloured_LED_init(void) {}

__weak void red_led_on(void) {}

應該是沒有實現的。

    bl red_led_on


    /* call board_init_r(gd_t *id, ulong dest_addr) */
    mov     r0, r9                  /* gd_t */  //r0 放GD頭指標
    ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */  r1放目的地址
    /* call board_init_r */
    ldr pc, =board_init_r   /* this is auto-relocated! */
board_init_r 函數在arch/arm/lib/board.c中,明天繼續

    /* we should not return here. */


#endif


ENDPROC(_main)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.