Introduction
qemu-jz is the qemu folk for JZ Soc emulation. Currently JZ4740 and pavo demo board is supported.
build qemu-jz
Download the qemu-jz from here. Please install the dependency library first. GCC-3.4 is suggested to build qemu-jz.
wget http://jz-hacking.googlecode.com/files/qemu-JZ_20090207.tar.gz
tar zxvf qemu-JZ_20090207.tar.gz
cd qemu-JZ
./configure --target-list=mipsel-softmmu
make
Tips: In MAC, you can use the flowing compile flag:
./configure --disable-sdl --disable-aio --enable-cocoa --prefix=/opt/qemu --target-list=mipsel-softmmu
build u-boot
Prebuild image. Change its name to u-boot-nand.bin.
wget http://jz-hacking.googlecode.com/files/jz_uboot_20090624.tar.bz2
tar jz_uboot_20090624.tar.bz2
cd jz_uboot
Change line 46 of jz_uboot/borad/pavo/u-boot-nand.lds.
46 - __got_start = .;
46 + __got_start = ALIGN(16);
make pavo_nand_config
make
build linux
Prebuild image. Change its name to uImage.
wget http://jz-hacking.googlecode.com/files/jz_linux_2.6.24.3_20090624.tar.bz2
tar jxvf jz_linux_2.6.24.3_20090624.tar.bz2
cd jz_linux
Download the config file of linux kernel.
wget http://jz-hacking.googlecode.com/files/pavo_config_linux_2.6.24.3
mv pavo_config_linux_2.6.24.3 .config
make
uImage will be created in arch/mips/uboot/ directory.
make the yaffs2 image
We need mkyaffs2image tool to convert the rootfs into yaffs2 format. You CAN NOT use the tool from www.yaffs.net directly. Please use the utils from jz's linux patch. I strip the source code from jz's linux patch. Please download it first.
wget http://jz-hacking.googlecode.com/files/yaffs2.tar.bz2
tar jxvf yaffs2.tar.bz2
cd yaffs2/utils
make
Download rootfs and convert it to yaffs2 format.
wget http://jz-hacking.googlecode.com/files/root26.tar.bz2
tar jxvf root26.tar.bz2
mkyaffs2image 1 root26 rootfs.yaffs2
build jz_tools
The tool 'pavo_nandflash' is used to generate the nand flash image used by pavo demo board. Libconfuse is needed to build jz_tools.
wget http://jz-hacking.googlecode.com/files/jz_tools_20090207.tar.gz
tar zxvf jz_tools_20090207.tar.gz
cd jz_tools/nand_flash
make clean
make
make the nand flash image
The last step is to make the nand flash image for pavo emulation. Assume we are in directory jz_tools/nand_flash. Edit the pavo_nandflash.conf.
``` #
pavo board nand flash configuration file.
Copyright (C) 2008 yajin(yajin@vm-kernel.org)
#
comment the unwanted part
flash_image = pavo-nand.bin
uboot_image = u-boot-nand.bin uboot_start = 0x00000000 uboot_end = 0x00400000 uboot_add_ecc = 0
kernel_image = uImage kernel_start = 0x00400000 kernel_end = 0x00800000 kernel_add_ecc = 0
rootfs_image = rootfs.yaffs2 rootfs_start = 0x00800000 rootfs_end = 0x08000000 rootfs_oob = 1 rootfs_add_ecc = 0 ```
Copy u-boot-nand.bin from uboot and uImage from linux to current directory. Copy rootfs.yaffs2 to currently directory too. Run pavo_nand_flash
./pavo_nandflash
Nand flash image pavo-nand.bin will be generated.
run qemu-jz
Copy pavo-nand.bin to qemu-JZ/mipsel-softmmu directory. CD to qemu-JZ.
./qemu-system-mipsel -M pavo -mtdblock pavo-nand.bin
Using ctl+alt+1 to switch lcd panel and ctl+alt+3 to serial console. When you enter linux 2.6 shell. Type 'runqpe'. Do not forget to calibrate touchscreen in qtopia before playing with it. Settings->recalibrate.
Following is the screenshot of qtopia on qemu-jz.