aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/stellaris.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2014-05-19 23:31:33 -0700
committerAndreas Färber <afaerber@suse.de>2014-05-28 17:36:21 +0200
commitde77914e50477ca4cef1e9cdd7a05b8d0c0ff1d9 (patch)
tree258a8cd908ee70b4371f8e2102230fff20a49e60 /hw/arm/stellaris.c
parenta5f54290ceb31281158413d4cda1ca80908a56cc (diff)
downloadqemu-de77914e50477ca4cef1e9cdd7a05b8d0c0ff1d9.zip
qemu-de77914e50477ca4cef1e9cdd7a05b8d0c0ff1d9.tar.gz
qemu-de77914e50477ca4cef1e9cdd7a05b8d0c0ff1d9.tar.bz2
ssi: Name the CS GPIO
To get it out of the default GPIO list. This allows child devices to use the un-named GPIO namespace without having to be SSI aware. That is, there is no more need for machines to know about the obscure policy where GPIO 0 is the SSI chip-select and GPIO 1..N are the concrete class GPIOs (defined locally as 0..N-1). This is most notable in stellaris, which uses a device which has both SSI and concrete level GPIOs. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/arm/stellaris.c')
-rw-r--r--hw/arm/stellaris.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 3b7a27a..80028e8 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1290,9 +1290,10 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
sddev = ssi_create_slave(bus, "ssi-sd");
ssddev = ssi_create_slave(bus, "ssd0323");
- gpio_out[GPIO_D][0] = qemu_irq_split(qdev_get_gpio_in(sddev, 0),
- qdev_get_gpio_in(ssddev, 0));
- gpio_out[GPIO_C][7] = qdev_get_gpio_in(ssddev, 1);
+ gpio_out[GPIO_D][0] = qemu_irq_split(
+ qdev_get_gpio_in_named(sddev, SSI_GPIO_CS, 0),
+ qdev_get_gpio_in_named(ssddev, SSI_GPIO_CS, 0));
+ gpio_out[GPIO_C][7] = qdev_get_gpio_in(ssddev, 0);
/* Make sure the select pin is high. */
qemu_irq_raise(gpio_out[GPIO_D][0]);