[U-Boot-Users] ARM cleanup - was: [GIT PULL] [ARM] Please pull fromgit://denx.de/git/u-boot-arm.git
Ulf Samuelsson
ulf at atmel.com
Tue Sep 4 09:25:57 CEST 2007
tor 2007-08-30 klockan 14:11 +0100 skrev Peter Pearse:
> Wolfgang
>
> I've got a bit lost here - can you explain a bit more.
> please excuse me if the following seems a bit basic - I just want to
> understand
> what I need to clean up.
>
> You said:
> --- snip ---
> > > I'm afraid I don't understand. We are not talking about any startup
> > > code, but about the code of the "reset" function, i. e. what
> > > casues the board to reset.
> --- snip ---
>
This is definitely not the code which causes the board to reset.
It is the code start up the MCU.
Since the MCU is already executing from SDRAM at this stage,
(loaded from dataflashboot.bin) there is no low level init to be done.
Any low level init at this stage will cause a crash.
> I can't find a reference to the reset function.
>
> There is do_reset() and set_cpu(), which the arm code supplies.
> The only use of reset I can see is as a label in the ARM start.S.
>
> The standard arm entry point to the U-Boot image is something like:-
>
> .globl _start
> _start: b reset
> ldr pc, _undefined_instruction
> ldr pc, _software_interrupt
> ldr pc, _prefetch_abort
> ldr pc, _data_abort
> ldr pc, _not_used
> ldr pc, _irq
> ldr pc, _fiq
>
> which is a (never currently used) imitation of the ARM architecture vector
> table.
>
> So when U-Boot runs it jumps to code of the form
>
> reset:
> Code to set the cpu to SVC32 mode
>
> #ifndef CONFIG_SKIP_LOWLEVEL_INIT
> Code to e.g. remap RAM
> #endif
>
> #ifndef CONFIG_SKIP_RELOCATE_UBOOT
> Copy U-Boot code to RAM
> #endif /* CONFIG_SKIP_RELOCATE_UBOOT */
>
> Code to
> set up the stack
> clear BSS
>
> Jump to board.c::start_armboot()
>
> --- snip ---
> >> The writers (and cut & pasters) of ARM code seem to have assumed that
> >> reset:
> >> is the entry to the code which runs immediately after the processor is
> >> reset, rather than the code which makes the processor reset.
>
> > Well, if that was the assumption, that all this code has obviously
> never been tested on any real hardware.
>
> >> Could we accept Ulf's code whilst I give this more consideration?
>
> > It's so utterly wrong that I think we have to clean this up before the
> next release.
> > If nobody submits a better patch, we will have to remove the bogus code.
> --- snip ---
>
> Is there anything that needs changing about the process I have described
> above?
>
> I could add ifdeffed code to really install the vector table at the ARM
> reset point(s),
> but it seems to me that the code will work OK as it is.
>
> I do need to work with Ulf to put his code down into cpu_init_crit.
> Both he & I missed the fact that CONFIG_BOOTBINFUNC got split &
> changed into the two CONFIG_SKIP defines.
>
> Regards
>
> Peter
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
--
Best Regards,
Ulf Samuelsson mail: ulf at atmel.com
Atmel Nordic AB
Box 2033, 174 52 Sundbyberg
Kavallerivägen 24, 174 58 Sundbyberg
Sweden
Tel: +46 8 441 54 22 GSM: +46 706 224457
More information about the U-Boot
mailing list