From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Id4Pa-0006UN-79 for qemu-devel@nongnu.org; Wed, 03 Oct 2007 09:37:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Id4PX-0006R7-9Y for qemu-devel@nongnu.org; Wed, 03 Oct 2007 09:37:13 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Id4PX-0006Qt-0g for qemu-devel@nongnu.org; Wed, 03 Oct 2007 09:37:11 -0400 Received: from mail.bawue.net ([193.7.176.63]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Id4PW-0005KX-KN for qemu-devel@nongnu.org; Wed, 03 Oct 2007 09:37:10 -0400 Date: Wed, 3 Oct 2007 14:37:06 +0100 From: Thiemo Seufer Subject: Re: [Qemu-devel] U-Boot patch for qemu -M mips Message-ID: <20071003133706.GM16772@networkno.de> References: <4702185B.3010807@comsys.ro> <20071002164027.GG16772@networkno.de> <470352E7.8050200@comsys.ro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <470352E7.8050200@comsys.ro> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vlad Lungu Cc: qemu-devel@nongnu.org, wd@denx.de Vlad Lungu wrote: [snip] >>> +long int initdram(int board_type) >>> +{ >>> + /* Sdram is setup by assembler code */ >>> + /* If memory could be changed, we should return the true value >>> here */ >>> + return MEM_SIZE*1024*1024; >>> >> >> Qemu gets the amount of RAM passed via a command line switch, the >> qemu-mips emulation sets up a Linux kernel like "command line" in >> memory where u-boot could parse it from. >> >> > Does it, or just when you pass -kernel to it? I'll check. Hm, you are right, it does that only for -kernel. Would it make sense to change that in Qemu? Since the mips_r4k machine doesn't correspond to any real hardware we have a bit of leeway with the "hardware" design. >>> +} >>> + >>> + >>> +int checkboard (void) >>> +{ >>> + u32 proc_id; >>> + >>> + proc_id = read_32bit_cp0_register(CP0_PRID); >>> + >>> + switch (proc_id >> 24) { >>> + default: >>> + printf ("Unsupported cpu %d, proc_id=0x%x\n", proc_id >> >>> 24, proc_id); >>> + } >>> + >>> + return 0; >>> +} >>> >> >> Huh? What is this code good for? >> >> > Checking for the type of board, I suppose :-) I think all BSPs have it and > it's called early in the boot process. I could either do only a return 0 or > actually decode CP0_PRID and print something meaningful, if Qemu sets it to > something sensible. Or just print a nice banner. As it is, this code prints a nice "Unsupported CPU" banner no matter what (and proceeds anyway instead of bailing out). Latest CVS Qemu supports a number of different CPUs (see the -cpu switch), the default for 32 bit is a 24Kf, and for 64 bit a R4000. Thiemo