This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: eCos + LPC21xx footprint
Jani Monoses <jani@iv.ro> writes:
> Hello
> would such a change in arm/vectors.S be to intrusive?
> The 'unused' vector entry is used by LPC's inflash bootloader to
> detect whether a valid image is present. The value is the checksum of
> the vector table, fixed since that table doesn't change. If not the
> download sequence starts else it assumes there's a program and it runs
> it.
> The Philips hostside (Windows only) downloader modifies the images it
> downloads on the fly, but on linux I chose to put the value in the
> image and not add more code to the loader I wrote.
> This means that it does not need to be calculated by every different download method :
> even redboot would not need to do anything extra when writing the flash.
>
> comments?
>
> --- orig/packages/hal/arm/arch/current/src/vectors.S
> +++ mod/packages/hal/arm/arch/current/src/vectors.S
> @@ -206,7 +206,7 @@
> ldr pc,.software_interrupt // 0x08 start && software int
> ldr pc,.abort_prefetch // 0x0C
> ldr pc,.abort_data // 0x10
> - .word 0 // unused
> +#ifdef CYGPKG_HAL_ARM_LPC2XXX
> + .word 0xB4405F62 // used by LPC2XXX bootloader, 32 bit
> +#endif
> checksum of the int vectors should be 0
> ldr pc,.IRQ // 0x18
> ldr pc,.FIQ // 0x1C
>
>
You still need an else clause for the non LPC2XXX cases.
However, we shouldn't have platform/variant specific ifdefs in
vectors.S. Also, a problem with your approach is that it assumes
that the vectors will remain constant. This is true of the interrupt
and exception vectors, however, the contents of the reset vector may
change depending on memory layout.
This checksum is something that needs to be calculated as late as
possible. So I think that your Linux download program needs to follow
what the Windows based ones do. RedBoot also needs to do the right
thing when writing block zero of the internal flash. This is possibly
something to be put into the device driver for the internal flash,
rather than added to RedBoot itself.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts