diff mbox

[1/1] sun4u: switch m48t59 NVRAM to MMIO access

Message ID 1421671327-13240-2-git-send-email-mark.cave-ayland@ilande.co.uk
State New
Headers show

Commit Message

Mark Cave-Ayland Jan. 19, 2015, 12:42 p.m. UTC
Real sun4u systems memory-map the NVRAM on the (ISA) ebus, so switch over to
MMIO from ioport access, adding the 68 year offset used by Sun systems. This
allows all SPARC64 OSs included in my tests to correctly detect the NVRAM IC
and read the hardware clock correctly upon boot.

Note that this also requires a corresponding OpenBIOS update to switch the
SPARC64 NVRAM accessors over from ioport to MMIO.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/sparc64/sun4u.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 86f5861..c315897 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -609,7 +609,7 @@  pci_ebus_init1(PCIDevice *pci_dev)
                              0, 0x1000000);
     pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar0);
     memory_region_init_alias(&s->bar1, OBJECT(s), "bar1", get_system_io(),
-                             0, 0x1000);
+                             0, 0x4000);
     pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &s->bar1);
     return 0;
 }
@@ -873,7 +873,7 @@  static void sun4uv_init(MemoryRegion *address_space_mem,
         fd[i] = drive_get(IF_FLOPPY, 0, i);
     }
     fdctrl_init_isa(isa_bus, fd);
-    nvram = m48t59_init_isa(isa_bus, 0, 0x0074, NVRAM_SIZE, 0, 59);
+    nvram = m48t59_init_isa(isa_bus, 0x2000, 0, NVRAM_SIZE, 68, 59);
 
     initrd_size = 0;
     initrd_addr = 0;