24
MOTOROLA
values, and then execute the program. The code can return to DINK by ending with a ‘blr’ instruction, or
by setting a breakpoint.
Changing the SPR registers using DINK can help with measuring program operation under varying
conditions; for example, if a program has been downloaded to address 0x90000, the following sequence:
DINK32_MPC755 >> rm -e l2cr
L2CR = 0x00000000
New Value ? 0x00000000
DINK32_MPC755 >> go 90000
(measure performance)
User code returned to DINK.
DINK32_MPC755 >> rm l2cr
L2CR = 0x00000000
New Value ? 0x3D014000
DINK32_MPC755 >> go 90000
(measure performance)
User code returned to DINK.
DINK32_MPC755 >>
By enabling or disabling the L2, the user code effectively emulates running on an MPC755 (w/L2 cache) or
an MPC745 (w/no L2 cache).
6.5 Saving User Code in Flash
DINK has the capability of saving user code to the ROM on the Sandpoint motherboard (but this overwrites
DINK itself) or to one of the two flashes on most MPMC cards. The “fupdate” command can be used for
this purpose:
Download the code to memory
dl -k -o 100000
and download your program as usual.
Make sure the PROGMODE switch on the MPMC card is on (see the configuration guides for the
corresponding MPMC card for switch location).
Issue the command:
fu -l 100000 ff000000 100000
(you can reduce the last argument to the actual size of your program).
Decide if you want to boot directly into your code (your code initializes the entire platform):
•
Turn the PROGMODE switch OFF
•
Set the ROMLOC switch to “RSC0 on local bus”
•
Press the reset button -- DINK will boot directly into your code.
Or if you want DINK to do the initialization, just leave the PROGMODE switch ON and DINK will boot
normally. To run your code, use the command “go ff000000” (or whatever the correct address may be). To
automatically run your code upon reset, enter the command:
ENV BOOT=0xFF000000