From: Dmitry Baryshkov <dbaryshkov@gmail.com>
To: qemu-devel@nongnu.org
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Subject: [Qemu-devel] [PATCH] scoop: GPRR reports the state of GPIO lines
Date: Sun, 2 Nov 2008 16:16:24 +0300 [thread overview]
Message-ID: <1225631790-15735-1-git-send-email-dbaryshkov@gmail.com> (raw)
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
---
hw/zaurus.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/zaurus.c b/hw/zaurus.c
index c475eaa..26e138d 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -46,7 +46,6 @@ struct scoop_info_s {
uint16_t irr;
uint16_t imr;
uint16_t isr;
- uint16_t gprr;
};
#define SCOOP_MCR 0x00
@@ -99,9 +98,8 @@ static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)
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 @@ static void scoop_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
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);
}
@@ -194,6 +190,7 @@ void scoop_gpio_out_set(struct scoop_info_s *s, int line,
static void scoop_save(QEMUFile *f, void *opaque)
{
struct scoop_info_s *s = (struct scoop_info_s *) opaque;
+ uint16_t dummy = 0;
qemu_put_be16s(f, &s->status);
qemu_put_be16s(f, &s->power);
qemu_put_be32s(f, &s->gpio_level);
@@ -205,11 +202,11 @@ static void scoop_save(QEMUFile *f, void *opaque)
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 +219,8 @@ static int scoop_load(QEMUFile *f, void *opaque, int version_id)
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 +241,7 @@ struct scoop_info_s *scoop_init(struct pxa2xx_state_s *cpu,
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;
}
--
1.5.6.5
next reply other threads:[~2008-11-02 13:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-02 13:16 Dmitry Baryshkov [this message]
2008-11-02 13:16 ` [Qemu-devel] [PATCH] tc6393xb: initial support for nand Dmitry Baryshkov
2008-11-02 13:16 ` [Qemu-devel] [PATCH] tosa: support leds Dmitry Baryshkov
2008-11-02 13:16 ` [Qemu-devel] [PATCH] tosa: basic lcd support Dmitry Baryshkov
2008-11-02 13:16 ` [Qemu-devel] [PATCH] tosa: provide correct IRQ to tc6393xb init Dmitry Baryshkov
2008-11-02 13:16 ` [Qemu-devel] [PATCH] tosa: disable pxafb as it's not used on tosa Dmitry Baryshkov
2008-11-02 13:16 ` [Qemu-devel] [PATCH] tc6393xb: non-accelerated FB support Dmitry Baryshkov
2008-11-02 16:31 ` andrzej zaborowski
2008-11-02 17:36 ` Dmitry Baryshkov
2008-11-02 19:40 ` Dmitry Baryshkov
2008-11-03 23:46 ` andrzej zaborowski
2008-11-04 3:14 ` Dmitry
2008-11-02 16:09 ` [Qemu-devel] [PATCH] tosa: basic lcd support andrzej zaborowski
2008-11-02 17:19 ` Dmitry Baryshkov
2008-11-04 9:14 ` andrzej zaborowski
2008-11-02 14:45 ` [Qemu-devel] Re: [PATCH] scoop: GPRR reports the state of GPIO lines Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1225631790-15735-1-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).