view sources/patches/qemu-sh4-append.patch @ 680:924527b0b454

Fix ppc bios, this is the one from qemu svn 6657.
author Rob Landley <rob@landley.net>
date Mon, 30 Mar 2009 04:50:02 -0500
parents 0d6c67c401e0
children
line wrap: on
line source

diff -ru qemu-0.10.0/hw/r2d.c qemu-0.10.0.new/hw/r2d.c
--- qemu-0.10.0/hw/r2d.c	2009-03-04 16:54:45.000000000 -0600
+++ qemu-0.10.0.new/hw/r2d.c	2009-03-18 12:42:25.000000000 -0500
@@ -233,20 +233,25 @@
         pci_nic_init(pci, &nd_table[i], (i==0)? 2<<3: -1, "rtl8139");
 
     /* Todo: register on board registers */
-    {
+    if (kernel_filename) {
       int kernel_size;
       /* initialization which should be done by firmware */
       stl_phys(SH7750_BCR1, 1<<3); /* cs3 SDRAM */
       stw_phys(SH7750_BCR2, 3<<(3*2)); /* cs3 32bit */
 
-      kernel_size = load_image(kernel_filename, phys_ram_base);
+      if (kernel_cmdline) {
+          kernel_size = load_image(kernel_filename, phys_ram_base + 0x80000);
+          env->pc = (SDRAM_BASE + 0x80000) | 0xa0000000;
+          pstrcpy(phys_ram_base + 0x10100, 256, kernel_cmdline);
+      } else {
+          kernel_size = load_image(kernel_filename, phys_ram_base);
+          env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */
+      }
 
       if (kernel_size < 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename);
         exit(1);
       }
-
-      env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */
     }
 }