qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5615] scoop: GPRR reports the state of GPIO lines (Dmitry Baryshkov).
@ 2008-11-04  8:49 Andrzej Zaborowski
  0 siblings, 0 replies; only message in thread
From: Andrzej Zaborowski @ 2008-11-04  8:49 UTC (permalink / raw)
  To: qemu-devel

Revision: 5615
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5615
Author:   balrog
Date:     2008-11-04 08:49:17 +0000 (Tue, 04 Nov 2008)

Log Message:
-----------
scoop: GPRR reports the state of GPIO lines (Dmitry Baryshkov).

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

Modified Paths:
--------------
    trunk/hw/zaurus.c

Modified: trunk/hw/zaurus.c
===================================================================
--- trunk/hw/zaurus.c	2008-11-04 08:47:06 UTC (rev 5614)
+++ trunk/hw/zaurus.c	2008-11-04 08:49:17 UTC (rev 5615)
@@ -46,7 +46,6 @@
     uint16_t irr;
     uint16_t imr;
     uint16_t isr;
-    uint16_t gprr;
 };
 
 #define SCOOP_MCR	0x00
@@ -99,9 +98,8 @@
     case SCOOP_GPCR:
         return s->gpio_dir;
     case SCOOP_GPWR:
-        return s->gpio_level;
     case SCOOP_GPRR:
-        return s->gprr;
+        return s->gpio_level;
     default:
         zaurus_printf("Bad register offset " REG_FMT "\n", addr);
     }
@@ -144,12 +142,10 @@
         scoop_gpio_handler_update(s);
         break;
     case SCOOP_GPWR:
+    case SCOOP_GPRR:	/* GPRR is probably R/O in real HW */
         s->gpio_level = value & s->gpio_dir;
         scoop_gpio_handler_update(s);
         break;
-    case SCOOP_GPRR:
-        s->gprr = value;
-        break;
     default:
         zaurus_printf("Bad register offset " REG_FMT "\n", addr);
     }
@@ -205,11 +201,11 @@
     qemu_put_be16s(f, &s->irr);
     qemu_put_be16s(f, &s->imr);
     qemu_put_be16s(f, &s->isr);
-    qemu_put_be16s(f, &s->gprr);
 }
 
 static int scoop_load(QEMUFile *f, void *opaque, int version_id)
 {
+    uint16_t dummy;
     struct scoop_info_s *s = (struct scoop_info_s *) opaque;
     qemu_get_be16s(f, &s->status);
     qemu_get_be16s(f, &s->power);
@@ -222,7 +218,8 @@
     qemu_get_be16s(f, &s->irr);
     qemu_get_be16s(f, &s->imr);
     qemu_get_be16s(f, &s->isr);
-    qemu_get_be16s(f, &s->gprr);
+    if (version_id < 1)
+	    qemu_get_be16s(f, &dummy);
 
     return 0;
 }
@@ -243,7 +240,7 @@
     iomemtype = cpu_register_io_memory(0, scoop_readfn,
                     scoop_writefn, s);
     cpu_register_physical_memory(s->target_base, 0x1000, iomemtype);
-    register_savevm("scoop", instance, 0, scoop_save, scoop_load, s);
+    register_savevm("scoop", instance, 1, scoop_save, scoop_load, s);
 
     return s;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-04  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-04  8:49 [Qemu-devel] [5615] scoop: GPRR reports the state of GPIO lines (Dmitry Baryshkov) Andrzej Zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).