aboutsummaryrefslogtreecommitdiff
path: root/hw/ssi-sd.c
diff options
context:
space:
mode:
authorPeter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>2012-07-24 12:23:22 +1000
committerPeter Crosthwaite <peter.crosthwaite@xilinx.com>2012-10-10 11:13:31 +1000
commit66530953319427d7c67a723076acd68075dc7db2 (patch)
tree6db9a1fea1d50f2d02a3ffeacb922332df9d208a /hw/ssi-sd.c
parentb4a76e84f4997392c9d2eb6f4373dc376d2ffd82 (diff)
ssi: Implemented CS behaviour
Added default CS behaviour for SSI slaves. SSI devices can set a property to enable CS behaviour which will create a GPIO on the device which is the CS. Tristating of the bus on SSI transfers is implemented. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Acked-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ssi-sd.c')
-rw-r--r--hw/ssi-sd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/ssi-sd.c b/hw/ssi-sd.c
index b519bdb29a..cbbc645213 100644
--- a/hw/ssi-sd.c
+++ b/hw/ssi-sd.c
@@ -197,6 +197,7 @@ static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val)
static void ssi_sd_save(QEMUFile *f, void *opaque)
{
+ SSISlave *ss = SSI_SLAVE(opaque);
ssi_sd_state *s = (ssi_sd_state *)opaque;
int i;
@@ -209,10 +210,13 @@ static void ssi_sd_save(QEMUFile *f, void *opaque)
qemu_put_be32(f, s->arglen);
qemu_put_be32(f, s->response_pos);
qemu_put_be32(f, s->stopping);
+
+ qemu_put_be32(f, ss->cs);
}
static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
{
+ SSISlave *ss = SSI_SLAVE(opaque);
ssi_sd_state *s = (ssi_sd_state *)opaque;
int i;
@@ -229,6 +233,8 @@ static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
s->response_pos = qemu_get_be32(f);
s->stopping = qemu_get_be32(f);
+ ss->cs = qemu_get_be32(f);
+
return 0;
}