From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 18E08B7B73 for ; Fri, 28 Aug 2009 01:53:13 +1000 (EST) Received: from mail-gx0-f215.google.com (mail-gx0-f215.google.com [209.85.217.215]) by ozlabs.org (Postfix) with ESMTP id 15CE7DDD04 for ; Fri, 28 Aug 2009 01:53:10 +1000 (EST) Received: by gxk11 with SMTP id 11so1391775gxk.16 for ; Thu, 27 Aug 2009 08:53:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090826192030.GA17027@b07421-ec1.am.freescale.net> References: <20090826192030.GA17027@b07421-ec1.am.freescale.net> Date: Thu, 27 Aug 2009 23:53:07 +0800 Message-ID: Subject: Re: Can't write value into memory ?(E500 V2) From: "wilbur.chan" To: Scott Wood Content-Type: multipart/alternative; boundary=0016e646182e4be4210472219078 Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0016e646182e4be4210472219078 Content-Type: text/plain; charset=ISO-8859-1 2009/8/27 Scott Wood > > > //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 . --0016e646182e4be4210472219078 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/8/27 Scott Wood <scottwood@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, s= ince you wrote a byte and read back a
word.

Furthermore, you are storing the constant 30, but are comparin= g r23 with
the register r30 (I never liked that aspect of ppc asm syntax= -- too
error prone). =A0If you want to compare with the constant 30, us= e "cmpwi".

> beq =A0print_equal
>
> 1: b 1b
&g= t;
> print_equal:
> =A0...
> //code end
>
> I= found that, print_equal was not called ,the whole code seemed =A0to
>= ; enter an =A0infinite loop.

That's because you have an infinite loop in your code, right = after "beq
print_equal".

-Scott=

=A0
=A0
Thank you very much.
=A0
I am using a SMP E500 v2, and I want CPU0 to write some value to a phy= sical address, and
=A0
wait for CPU1 to read from it.
=A0
However, it seemed failed to communicate between CPUs by DRAM..=A0 CPU= 1 can not read
=A0
the correct value from the address where CPU1 wrote to.
=A0
BTW: the physical address is=A0 at 16M .
=A0
=A0
--0016e646182e4be4210472219078--