summaryrefslogtreecommitdiff
path: root/hw/pl061.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-24 23:35:08 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-24 23:35:08 +0000
commit775616c3ae8c9bdd43d57274f259b09ae87217b0 (patch)
tree0c27d7758d5f3ab8d89fcaa3e9ab181366dc1cae /hw/pl061.c
parentf3b9f954326d5010c7215a3a023264204afd3c42 (diff)
Partial SD card SPI mode support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3731 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pl061.c')
-rw-r--r--hw/pl061.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/hw/pl061.c b/hw/pl061.c
index d9a6f50f86..3ac0a4c100 100644
--- a/hw/pl061.c
+++ b/hw/pl061.c
@@ -48,6 +48,7 @@ typedef struct {
uint8_t slr;
uint8_t den;
uint8_t cr;
+ uint8_t float_high;
qemu_irq irq;
qemu_irq out[8];
} pl061_state;
@@ -56,18 +57,22 @@ static void pl061_update(pl061_state *s)
{
uint8_t changed;
uint8_t mask;
+ uint8_t out;
int i;
- changed = s->old_data ^ s->data;
+ /* Outputs float high. */
+ /* FIXME: This is board dependent. */
+ out = (s->data & s->dir) | ~s->dir;
+ changed = s->old_data ^ out;
if (!changed)
return;
- s->old_data = s->data;
+ s->old_data = out;
for (i = 0; i < 8; i++) {
mask = 1 << i;
- if ((changed & mask & s->dir) && s->out) {
- DPRINTF("Set output %d = %d\n", i, (s->data & mask) != 0);
- qemu_set_irq(s->out[i], (s->data & mask) != 0);
+ if ((changed & mask) && s->out) {
+ DPRINTF("Set output %d = %d\n", i, (out & mask) != 0);
+ qemu_set_irq(s->out[i], (out & mask) != 0);
}
}