Dear All, thanks for the help. I used the last svn copy and it works fine: URL: svn://svn.savannah.nongnu.org/qemu/trunk Repository Root: svn://svn.savannah.nongnu.org/qemu Repository UUID: c046a42c-6fe2-441c-8c8c-71466251a162 Revision: 6436
Anyway I created a trivial patch in order to permit to have an arbitrary flash size on mips board (I'm need to simulate a board with 32MB instead the usual 4M). Using the patch, the flash memory placed at the end of 0xbfxxxxxxxx memory space: 4MB flash: start bfc00000 -> end bfffffff 8MB flash: start bf800000 -> end bfffffff 16MB flash: start bf000000 -> end bfffffff 32MB flash: start be000000 -> end bfffffff The firmware must be placed always at address 0xbfc00000. these are the relative address on the file: 4MB flash: firmware offset +0 8MB flash: firmware offset +4MB 16MB flash: firmware offset +12MB 32MB flash: firmware offset +28MB To create the image files, use the following trivial script: dd if=/dev/zero of=flash.img bs=$flashsize count=1 conv=sync dd if=u-boot.bi of=flash.img bs=1 seek=$biosbase conv=notrunc Thanks again for your support. luigi On Monday 26 January 2009 13:53:07 Jean-Christophe PLAGNIOL-VILLARD wrote: > On 10:13 Mon 26 Jan , Luigi 'Comio' Mantellini wrote: > > Hi ML, > > > > I'm evaluating the qemu-mips to simulate a mips 4kec/24kec board. I'm > > working on the high level booting sequence (linux init scripts), and > > qemu+uboot should be a good choice to emulate a basic system (flash + > > dram + 4kec cpu). > > > > Furthermore, also following the doc/README.qemu_mips, I'm not able to see > > the u-boot prompt on my qemu because the flash is not recognized. I > > haven't experience with qemu-mips and I don't understand where the flash > > is placed (canonical 0xbfxxxx address?) and how it is managed. Reading > > the configs/qemu_mips.h, It seems that the flash is managed as a common > > CFI flash placed to 0xbfc00000 address... but u-boot shows always > > "Unknown FLASH on Bank 1" on startup. > > > > Has anyone tried to use qemu-mips to boot a standard u-boot image > > (qemu_mips target on u-boot)? > > > > > > Thanks for any suggestion. > > > > luigi > > > > ########### Useful Infos ############ > > > > This is the qemu banner (on Ubuntu 8.10): > > > > EMU PC emulator version 0.9.1, Copyright (c) 2003-2008 Fabrice Bellard > > Please use the SVN version of qemu for the current u-boot version > > I'll update the README.qemu_mips to specify the last u-boot version for the > old qemu > > Best Regards, > J. -- Luigi Mantellini R&D - Software Industrie Dial Face S.p.A. Via Canzo, 4 20068 Peschiera Borromeo (MI), Italy Tel.: +39 02 5167 2813 Fax: +39 02 5167 2459 Email: luigi.mantell...@idf-hit.com
Index: hw/mips_r4k.c =================================================================== --- hw/mips_r4k.c (revision 6436) +++ hw/mips_r4k.c (working copy) @@ -16,7 +16,10 @@ #include "boards.h" #include "flash.h" #include "qemu-log.h" +#include "block_int.h" +#include <sys/stat.h> + #ifdef TARGET_WORDS_BIGENDIAN #define BIOS_FILENAME "mips_bios.bin" #else @@ -205,10 +208,16 @@ cpu_register_physical_memory(0x1fc00000, BIOS_SIZE, bios_offset | IO_MEM_ROM); } else if ((index = drive_get_index(IF_PFLASH, 0, 0)) > -1) { + struct stat infobuf; /* place to store info */ uint32_t mips_rom = 0x00400000; - cpu_register_physical_memory(0x1fc00000, mips_rom, + + if (stat(drives_table[index].bdrv->filename, &infobuf) == 0) { + mips_rom = infobuf.st_size; + } + + cpu_register_physical_memory(0x20000000 - mips_rom, mips_rom, qemu_ram_alloc(mips_rom) | IO_MEM_ROM); - if (!pflash_cfi01_register(0x1fc00000, qemu_ram_alloc(mips_rom), + if (!pflash_cfi01_register(0x20000000 - mips_rom, qemu_ram_alloc(mips_rom), drives_table[index].bdrv, sector_len, mips_rom / sector_len, 4, 0, 0, 0, 0)) { fprintf(stderr, "qemu: Error registering flash memory.\n");
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot