Can't write value into memory ?(E500 V2)

wilbur.chan wilbur512 at gmail.com
Fri Aug 28 01:53:07 EST 2009


2009/8/27 Scott Wood <scottwood at freescale.com>

>
> > //check if we successfully store value at 0x400,0000
> >
> > lis r22, 0x400
> > ori r22,r22,0x0
> > lwz r23,0(r22)
> > cmpw r23, 30
>
> The values should not be equal, since you wrote a byte and read back a
> word.
>
> Furthermore, you are storing the constant 30, but are comparing r23 with
> the register r30 (I never liked that aspect of ppc asm syntax -- too
> error prone).  If you want to compare with the constant 30, use "cmpwi".
>
> > beq  print_equal
> >
> > 1: b 1b
> >
> > print_equal:
> >  ...
> > //code end
> >
> > I found that, print_equal was not called ,the whole code seemed  to
> > enter an  infinite loop.
>
> That's because you have an infinite loop in your code, right after "beq
> print_equal".
>
> -Scott
>



Thank you very much.

I am using a SMP E500 v2, and I want CPU0 to write some value to a physical
address, and

wait for CPU1 to read from it.

However, it seemed failed to communicate between CPUs by DRAM..  CPU1 can
not read

the correct value from the address where CPU1 wrote to.

BTW: the physical address is  at 16M .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090827/ae61bffe/attachment.htm>


More information about the Linuxppc-dev mailing list