start.S


stage 1:

  reset:

      set the cpu to svc32 mode

      disable the watchdog

      mask all IRQs(INTMSK, INTSUBMSK)


      cpu_init_crit(mmu, bus width status controller)

      set up the stack

      clock_init


      relocate u-boot ro RAM:

        copy code to RAM

        clear bbs

        setLoadFlag


stage 2:

      start_armboot()

      {

        gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));

        memset gd;

        init_sequence();


        for(;;)

        {

          main_loop();

        }

      }