From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR1NJ-0007Yk-Bb for qemu-devel@nongnu.org; Sun, 25 Jan 2009 04:33:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR1NG-0007Vs-Gi for qemu-devel@nongnu.org; Sun, 25 Jan 2009 04:33:52 -0500 Received: from [199.232.76.173] (port=47975 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR1NG-0007Vh-90 for qemu-devel@nongnu.org; Sun, 25 Jan 2009 04:33:50 -0500 Received: from 2.mail-out.ovh.net ([91.121.26.226]:47949) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LR1NF-0003up-PI for qemu-devel@nongnu.org; Sun, 25 Jan 2009 04:33:50 -0500 Date: Sun, 25 Jan 2009 10:18:11 +0100 From: Jean-Christophe PLAGNIOL-VILLARD Subject: Re: [Qemu-devel] [RFC] [PATCH] r2d add pflash support Message-ID: <20090125091811.GA13277@game.jcrosoft.org> References: <1232296556-8752-1-git-send-email-plagnioj@jcrosoft.com> <1232396344-30061-1-git-send-email-plagnioj@jcrosoft.com> <200901250521.n0P5LLgo024436@smtp09.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901250521.n0P5LLgo024436@smtp09.dti.ne.jp> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: takasi-y@ops.dti.ne.jp Cc: KAWASAKI , Shin-ichiro@game.jcrosoft.org, qemu-devel@nongnu.org On 14:21 Sun 25 Jan , takasi-y@ops.dti.ne.jp wrote: > Hi, > Sorry for slow response (as is usual....) > > > +#define FLASH_BASE 0xa0000000 > I think this should be physical address but P2. > Like #define FLASH_BASE 0x00000000 > > > + } else { > > + env->pc = FLASH_BASE; > > + } > I think "-pflash" should not set PC, but simply provede initial content > of FLASH. no you need it other wise you can not boot from the bootloader > On the other hand, "-kernel" sets PC because it is a pseudo firmware task. > > > - env->pc = (SDRAM_BASE + 0x80000) | 0xa0000000; > > + env->pc = (SDRAM_BASE + 0x80000) | FLASH_BASE; > ... > > - env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */ > > + env->pc = SDRAM_BASE | FLASH_BASE; /* Start from P2 area */ > These are not needed. > These 0xa0000000 mean P2, nothing related with FLASH. the FLASH is connected to there > > > --- a/target-sh4/helper.c > > +++ b/target-sh4/helper.c > > @@ -436,8 +436,8 @@ int get_physical_address(CPUState * env, target_ulong * physical, > > else > > return MMU_IADDR_ERROR; > > } > > - if (address >= 0x80000000 && address < 0xc0000000) { > > - /* Mask upper 3 bits for P1 and P2 areas */ > > + if (address >= 0x80000000 && address < 0xa0000000) { > > + /* Mask upper 3 bits for P1 area */ > > *physical = address & 0x1fffffff; > > } else { > > *physical = address; > You needed this because you have defined FLASH address as P2. > Chaning it to physical as shown above makes this not be needed. But the flash is map to P2 Best Regards, J.