[U-Boot-Users] mpc824x/start.S

Matthew McClintock mattsm at arlut.utexas.edu
Wed May 28 15:11:19 CEST 2003


I have a question for everyone on the list. I am booting u-boot on a
custom mpc824x board (utx8245) and I have run into a minor annoyance. In
start.S you have the following code in relocate_code:
 
relocate_code:
 
            mr        r1,  r3                /* Set new stack pointer
*/
            mr        r9,  r4                /* Save copy of Global Data
pointer          */
            mr        r10, r5               /* Save copy of Destination
Address        */
 
            mr        r3,  r5                                        /*
Destination Address    */
#ifdef DEBUG
            lis         r4, CFG_SDRAM_BASE at h                   /* Source
Address     */
            ori         r4, r4, CFG_SDRAM_BASE at l
#else
            lis         r4, CFG_MONITOR_BASE at h                /* Source
Address     */
            ori         r4, r4, CFG_MONITOR_BASE at l
#endif
            lis         r5, CFG_MONITOR_LEN at h                   /*
Length in Bytes          */
            ori         r5, r5, CFG_MONITOR_LEN at l
            li           r6, CFG_CACHELINE_SIZE                    /*
Cache Line Size         */
 
            /*
             * Fix GOT pointer:
             *
             * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) +
Destination Address
             *
             * Offset:
 
Now I am curious why when you are running in debug mode you choose to
copy everything from CFG_SDRAM_BASE, while working normally you copy it
from CFG_MONITOR_BASE. For us there is nothing to be copied at
CFG_SDRAM_BASE and u-boot crashes right after it relocates the code and
jumps to the copied point. We get around this obviously by doing the
following:
 
relocate_code:
 
            mr        r1,  r3                /* Set new stack pointer
*/
            mr        r9,  r4                /* Save copy of Global Data
pointer          */
            mr        r10, r5               /* Save copy of Destination
Address        */
 
            mr        r3,  r5                                        /*
Destination Address    */
#ifdef DEBUG
            lis         r4, CFG_MONITOR_BASE at h                /* Source
Address     */
            ori         r4, r4, CFG_MONITOR_BASE at l
#else
            lis         r4, CFG_MONITOR_BASE at h                /* Source
Address     */
            ori         r4, r4, CFG_MONITOR_BASE at l
#endif
            lis         r5, CFG_MONITOR_LEN at h                   /*
Length in Bytes          */
            ori         r5, r5, CFG_MONITOR_LEN at l
            li           r6, CFG_CACHELINE_SIZE                    /*
Cache Line Size         */
 
            /*
             * Fix GOT pointer:
             *
             * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) +
Destination Address
             *
             * Offset:
 
This is a hack, and it cannot be merged back into u-boot so I was
wondering if there was a more eloquent way to do this, something else I
am missing that will make my program work while in debug mode with an
unmodified start.S.
 
Thanks for your time,
Matthew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20030528/2e21662f/attachment.htm 


More information about the U-Boot mailing list