Can you give the full command line you're using ?Neumaennl wrote:Torlus: I did try to log in via the console, but couldn't...
Can you give the full command line you're using ?Neumaennl wrote:Torlus: I did try to log in via the console, but couldn't...
I did. It was in my initial post.Torlus wrote:Can you give the full command line you're using ?Neumaennl wrote:Torlus: I did try to log in via the console, but couldn't...
I'm trying to do the GPIO module based on your bcm2835_* files.Torlus wrote:Hi,
@tavy : GPIO isn't available yet, but shouldn't too hard to do... question is, why and what should it "connect" to at the host level ?
Greg
Does it work on hardware (I guess it does...) ? Which timer are you using ? It might be an issue with timer resolution...tastenmonster wrote:Hi, I successfully compiled yout patches and I am able to run basic baremetal code on rpi emulation. Is the Arm timer emulation working? I can't get an interrupt from this?
The ARM side timer with baseaddress 0x2000B400 is used. I play around with the rtems bsp for rpi. see http://www.raspberrypi.org/phpBB3/viewt ... 72&t=38962 It would be great to use your emulation for debugging and testing.Torlus wrote:Hi,Does it work on hardware (I guess it does...) ? Which timer are you using ? It might be an issue with timer resolution...tastenmonster wrote:Hi, I successfully compiled yout patches and I am able to run basic baremetal code on rpi emulation. Is the Arm timer emulation working? I can't get an interrupt from this?
tastenmonster wrote:The ARM side timer with baseaddress 0x2000B400 is used. I play around with the rtems bsp for rpi. see http://www.raspberrypi.org/phpBB3/viewt ... 72&t=38962 It would be great to use your emulation for debugging and testing.Torlus wrote:Hi,Does it work on hardware (I guess it does...) ? Which timer are you using ? It might be an issue with timer resolution...tastenmonster wrote:Hi, I successfully compiled yout patches and I am able to run basic baremetal code on rpi emulation. Is the Arm timer emulation working? I can't get an interrupt from this?
Code: Select all
#define APBCLOCK_FREQ (252000000)
Code: Select all
s->control = value & 0x00ff03ae;
Thanks for looking into this. I've put qemu on the shelf for now, but it's nice to know that when I get back to it, that won't be an issue.JonD wrote:Hi Torlus, ShiftPlusOne,
Looks like I've found the compile issue. There were a couple of fixes for the Win32 build that went in just after torlus' last merge, on March 10th. Nothing more than a few ifdef __WIN32's
Now builds just fine under MinGW, but I still get the black screen, and Qemu shows as "stopped"
Best regards
Jonathan
Code: Select all
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 8f71a9e..2c16e07 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -47,7 +47,7 @@ const uint32_t bootloader_0[] = {
0x00008000
};
-const uint32_t bootloader_400[] = {
+uint32_t bootloader_100[] = {
0x00000005,
0x54410001,
0x00000001,
@@ -55,7 +55,7 @@ const uint32_t bootloader_400[] = {
0x00000000,
0x00000004,
0x54410002,
-0x08000000,
+0x08000000, /* This value will be overwritten by dynamically calculated memory size */
0x00000000,
0x00000000,
0x00000000
@@ -110,6 +110,8 @@ static void raspi_init(QEMUMachineInitArgs *args)
bcm2835_vcram_base = args->ram_size - VCRAM_SIZE;
+ bootloader_100[7] = bcm2835_vcram_base; /* Write real RAM size in ATAG structure */
+
memory_region_init_ram(bcm2835_ram, "raspi.ram", bcm2835_vcram_base);
vmstate_register_ram_global(bcm2835_ram);
@@ -326,8 +328,8 @@ static void raspi_init(QEMUMachineInitArgs *args)
for(n = 0; n < ARRAY_SIZE(bootloader_0); n++) {
stl_phys( (n << 2), bootloader_0[n]);
}
- for(n = 0; n < ARRAY_SIZE(bootloader_400); n++) {
- stl_phys( 0x400 + (n << 2), bootloader_400[n]);
+ for(n = 0; n < ARRAY_SIZE(bootloader_100); n++) {
+ stl_phys( 0x100 + (n << 2), bootloader_100[n]);
}
load_image_targphys(args->initrd_filename,
0x8000,
The code for the mem{cpy,cmp,set, move} replacements we're using are at https://github.com/bavison/arm-memJacobL wrote: Edit: Turns out this is most likely the implementation of memcmp, which is not on github. I tried to add some debug to the illegal instruction handler, and noticed that when libcofi_rpi is running, then an extra instruction gets added to the list: 0xF1010200, which is setend trying to set big endian mode. If I grep a hexdump of libcofi_rpi.so, then I find this instruction 0x638 bytes into the file. If I run readelf on the file, then I can see that the memcmp symbol starts at 0x634. The comment in Qemu says "Dynamic endianness switching not implemented", so I suppose this is on purpose. I guess to make it work, one would have to first make all load/store operations respect CPSR[9], the "E" bit, which should add big endian data support. Luckily, setend only affects data endianness, not instruction endianness (seems big-endian instructions is referred to as a legacy mode on ARMv6 in the ARM ARM).
Ahh. It moved. I did wonder why most recent commit was 10 months ago. Thanks.asb wrote:The code for the mem{cpy,cmp,set, move} replacements we're using are at https://github.com/bavison/arm-mem
Code: Select all
sudo apt-get install git zlib1g-dev libsdl1.2-dev libpixman-1-dev
git clone git://github.com/Torlus/qemu.git -b rpi
cd qemu
./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --prefix=/opt/qemu-rpi
make -j[number of threads supported by PC]
sudo make install
Code: Select all
sudo kpartx -a [raspbian image]
sudo mount /dev/mapper/loop0p1 fat
sudo mount /dev/mapper/loop0p2 linux
Code: Select all
sudo umount linux
sudo umount fat
sudo kpartx -d [raspbian image]
Code: Select all
/opt/qemu-rpi/bin/qemu-system-arm -kernel kernel.img -cpu arm1176 -m 512 -M raspi -no-reboot -serial stdio -append "rw earlyprintk loglevel=8 panic=120 keep_bootcon rootwait dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1024 bcm2708_fb.fbheight=768 bcm2708.boardrev=0xf bcm2708.serial=0xcad0eedf smsc95xx.macaddr=B8:27:EB:D0:EE:DF sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1c000000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait" -sd [raspbian image] -device usb-kbd -device usb-mouse -snapshot
Code: Select all
$ /opt/qemu-rpi/bin/qemu-system-arm -version
QEMU emulator version 1.4.93, Copyright (c) 2003-2008 Fabrice Bellard
Code: Select all
=== PROPERTY MBOX PUSH BEGIN addr=5ba6e000
Request:
[00000020] [00000000] [00030006] [00000008] [00000000] [00000000] [00000000] [00000000]
TAG [00030006]
TAG [00000000]
Response:
[00000020] [80000000] [00030006] [00000008] [80000008] [00000000] [000061a8] [00000000]
=== PROPERTY MBOX PUSH END
=== PROPERTY MBOX PUSH BEGIN addr=5ba6e000
Request: