[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 29/32] PPC: Newworld: Add uninorth token register
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 29/32] PPC: Newworld: Add uninorth token register |
Date: |
Sun, 30 Jun 2013 03:45:06 +0200 |
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 <address@hidden>
---
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..7b512ca 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
- [Qemu-ppc] [PULL 00/32] ppc patch queue 2013-06-30, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 02/32] KVM: Export kvm_init_irq_routing, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 06/32] KVM: PIC: Only commit irq routing when necessary, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 03/32] KVM: MSI: Swap payload to native endianness, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 16/32] ppc: do not register IABR SPR twice for 603e, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 01/32] KVM: Don't assume that mpstate exists with in-kernel PIC always, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 26/32] PPC: Fix GDB read on code area for PPC6xx, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 07/32] PPC: Add non-kvm stub file, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 12/32] mpc8544_guts: Fix MemoryRegion name, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 13/32] mpc8544_guts: QOM'ify, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 29/32] PPC: Newworld: Add uninorth token register,
Alexander Graf <=
- [Qemu-ppc] [PATCH 09/32] intc/openpic: QOM'ify, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 14/32] mpc8544_guts: Turn qdev initfn into instance_init, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 19/32] pseries: Fix compiler warning (conversion of pointer to integral value), Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 05/32] PPC: e500: factor out mpic init code, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 10/32] intc/openpic: Convert to QOM realize, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 22/32] Graphics: Switch to 800x600x32 as default mode, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 23/32] booke_ppc: limit booke timer to max when timeout overflow, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 11/32] intc/openpic_kvm: Fix QOM and build issues, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 30/32] PPC: Newworld: Add second uninorth control register set, Alexander Graf, 2013/06/29
- [Qemu-ppc] [PATCH 28/32] PPC: Add clock-frequency export for Mac machines, Alexander Graf, 2013/06/29