All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] PPC: Newworld: Some uni-n hacks
@ 2013-06-25  1:55 Alexander Graf
  2013-06-25  1:55 ` [Qemu-devel] [PATCH 1/2] PPC: Newworld: Add uninorth token register Alexander Graf
  2013-06-25  1:55 ` [Qemu-devel] [PATCH 2/2] PPC: Newworld: Add second uninorth control register set Alexander Graf
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Graf @ 2013-06-25  1:55 UTC (permalink / raw)
  To: qemu-ppc; +Cc: qemu-devel

Mac OS X has some internal insight into how a core99 style Mac is
supposed to work. It relies on a few bits in the uni-north topology
to exist.

These patches fake things well enough to make at least 10.4 happy.

With these as well as the previously sent patches and a few workarounds
in the guest kernel, I am able to boot up to the point where the guest
does not find its rootfs.


Alex

Alexander Graf (2):
  PPC: Newworld: Add uninorth token register
  PPC: Newworld: Add second uninorth control register set

 hw/ppc/mac_newworld.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] PPC: Newworld: Add uninorth token register
  2013-06-25  1:55 [Qemu-devel] [PATCH 0/2] PPC: Newworld: Some uni-n hacks Alexander Graf
@ 2013-06-25  1:55 ` Alexander Graf
  2013-06-25  1:55 ` [Qemu-devel] [PATCH 2/2] PPC: Newworld: Add second uninorth control register set Alexander Graf
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2013-06-25  1:55 UTC (permalink / raw)
  To: qemu-ppc; +Cc: qemu-devel

Mac OS X expects the uninorth control register set to contain one
register that always reads back what it writes in. Expose that.

This is just a temporary hack. Eventually, we want to expose the
uninorth (/uni-n in device tree) as a separate QOM device.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/mac_newworld.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index c6889d1..bf4fc7d 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -87,6 +87,9 @@ static void unin_write(void *opaque, hwaddr addr, uint64_t value,
                        unsigned size)
 {
     UNIN_DPRINTF("write addr " TARGET_FMT_plx " val %"PRIx64"\n", addr, value);
+    if (addr == 0x0) {
+        *(int*)opaque = value;
+    }
 }
 
 static uint64_t unin_read(void *opaque, hwaddr addr, unsigned size)
@@ -94,6 +97,11 @@ static uint64_t unin_read(void *opaque, hwaddr addr, unsigned size)
     uint32_t value;
 
     value = 0;
+    switch (addr) {
+    case 0:
+        value = *(int*)opaque;
+    }
+
     UNIN_DPRINTF("readl addr " TARGET_FMT_plx " val %x\n", addr, value);
 
     return value;
@@ -162,6 +170,7 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
     int machine_arch;
     SysBusDevice *s;
     DeviceState *dev;
+    int *token = g_new(int, 1);
 
     linux_boot = (kernel_filename != NULL);
 
@@ -279,8 +288,8 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
     /* Register 8 MB of ISA IO space */
     isa_mmio_init(0xf2000000, 0x00800000);
 
-    /* UniN init */
-    memory_region_init_io(unin_memory, &unin_ops, NULL, "unin", 0x1000);
+    /* UniN init: XXX should be a real device */
+    memory_region_init_io(unin_memory, &unin_ops, &token, "unin", 0x1000);
     memory_region_add_subregion(get_system_memory(), 0xf8000000, unin_memory);
 
     openpic_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] PPC: Newworld: Add second uninorth control register set
  2013-06-25  1:55 [Qemu-devel] [PATCH 0/2] PPC: Newworld: Some uni-n hacks Alexander Graf
  2013-06-25  1:55 ` [Qemu-devel] [PATCH 1/2] PPC: Newworld: Add uninorth token register Alexander Graf
@ 2013-06-25  1:55 ` Alexander Graf
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2013-06-25  1:55 UTC (permalink / raw)
  To: qemu-ppc; +Cc: qemu-devel

Mac OS X requires a second uninorth register set to be mapped a few
bytes above the first one. Let's just expose it to make it happy.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/mac_newworld.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index bf4fc7d..8a07879 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -152,6 +152,7 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
     char *filename;
     qemu_irq *pic, **openpic_irqs;
     MemoryRegion *unin_memory = g_new(MemoryRegion, 1);
+    MemoryRegion *unin2_memory = g_new(MemoryRegion, 1);
     int linux_boot, i, j, k;
     MemoryRegion *ram = g_new(MemoryRegion, 1), *bios = g_new(MemoryRegion, 1);
     hwaddr kernel_base, initrd_base, cmdline_base = 0;
@@ -292,6 +293,9 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
     memory_region_init_io(unin_memory, &unin_ops, &token, "unin", 0x1000);
     memory_region_add_subregion(get_system_memory(), 0xf8000000, unin_memory);
 
+    memory_region_init_io(unin2_memory, &unin_ops, &token, "unin", 0x1000);
+    memory_region_add_subregion(get_system_memory(), 0xf3000000, unin2_memory);
+
     openpic_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
     openpic_irqs[0] =
         g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-25  1:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25  1:55 [Qemu-devel] [PATCH 0/2] PPC: Newworld: Some uni-n hacks Alexander Graf
2013-06-25  1:55 ` [Qemu-devel] [PATCH 1/2] PPC: Newworld: Add uninorth token register Alexander Graf
2013-06-25  1:55 ` [Qemu-devel] [PATCH 2/2] PPC: Newworld: Add second uninorth control register set Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.