RAMBAR0 incorrectly set by __cs3_reset

Corrin Meyer Corrin.Meyer at dornerworks.com
Sat Nov 8 00:13:03 UTC 2008


I have started to experience a boot failure issue and I think I have
tracked it down to __cs3_reset.  The boot failure is resulting in an
access error and it appears that it is because that RAMBAR0 (FLASHBAR)
is being incorrectly set by the CS3 reset function __cs3_reset.  Below
are two versions of __cs3_reset as results from a compile that works and
a compile that doesn't.  The processor I am working with is a MCF52235.

 

This does work...

 

    3400:       223c 2000 0021  movel #536870945,%d1

    3406:       4e7b 1c05       movec %d1,%rambar1

    340a:       223c 0000 0021  movel #33,%d1

    3410:       4e7b 1c04       movec %d1,%rambar0

    3414:       700f            moveq #15,%d0

    3416:       13c0 4010 0074  moveb %d0,40100074
<__cs3_region_start_ipsbar+0x100074>

    341c:       4ef9 0001 be30  jmp 1be30 <_start>

 

This does not work...

 

    3400:       223c 2000 0021  movel #536870945,%d1

    3406:       4e7b 1c05       movec %d1,%rambar1

    340a:       223c 0000 3021  movel #12321,%d1

    3410:       4e7b 1c04       movec %d1,%rambar0

    3414:       700f            moveq #15,%d0

    3416:       13c0 4010 0074  moveb %d0,40100074
<__cs3_region_start_ipsbar+0x100074>

    341c:       4ef9 0001 be30  jmp 1be30 <_start>

 

It appears that in the working case 0x00000021 is being loaded in
RAMBAR0 and in the non-working case it is being loaded with 0x00003021.

 

The value 0x00003021 is setting bits in RAMBAR0 (FLASHBAR) that are
reserved and I believe it to be these bits (0x00003000) that are causing
my problems; using GDB and stepping through code I was able to examine
Flash memory correctly prior to setting RAMBAR0.  Once RAMBAR0 was set,
accessing the same memory locations resulted in corrupted data.

 

How is the value that is being loaded into RAMBAR0 being determined?  Is
there anyway that I can control what that value is without having to
replace the __cs3_reset (or maybe there is an easy way to override just
the __cs3_reset code without having to replace all of CS3)?

 

Corrin J. Meyer 
DornerWorks, Ltd. 
Embedded Systems Engineering 
  
T: 616.389.8336 
F: 616.245.8372 
E: corrin.meyer at dornerworks.com <mailto:corrin.meyer at dornerworks.com>  
  
3445 Lake Eastbrook Blvd. SE 
Grand Rapids, MI 49546 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20081107/6b0a053d/attachment.html>


More information about the coldfire-gnu-discuss mailing list