From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, crosthwaite.peter@gmail.com,
qemu-arm@nongnu.org, pbonzini@redhat.com,
alistair.francis@xilinx.com
Subject: [Qemu-devel] [PATCH v6 6/6] xlnx-ep108: Connect the SPI Flash
Date: Sat, 19 Dec 2015 21:43:38 -0800 [thread overview]
Message-ID: <aa67be9cbe0b7108123d2aeece904a170427cd46.1450570397.git.crosthwaite.peter@gmail.com> (raw)
In-Reply-To: <cover.1450570397.git.crosthwaite.peter@gmail.com>
In-Reply-To: <cover.1450570397.git.crosthwaite.peter@gmail.com>
From: Alistair Francis <alistair.francis@xilinx.com>
Connect the sst25wf080 SPI flash to the EP108 board.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
hw/arm/xlnx-ep108.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c
index 85b978f..d1912aa 100644
--- a/hw/arm/xlnx-ep108.c
+++ b/hw/arm/xlnx-ep108.c
@@ -33,6 +33,7 @@ static struct arm_boot_info xlnx_ep108_binfo;
static void xlnx_ep108_init(MachineState *machine)
{
XlnxEP108 *s = g_new0(XlnxEP108, 1);
+ int i;
Error *err = NULL;
object_initialize(&s->soc, sizeof(s->soc), TYPE_XLNX_ZYNQMP);
@@ -60,6 +61,21 @@ static void xlnx_ep108_init(MachineState *machine)
machine->ram_size);
memory_region_add_subregion(get_system_memory(), 0, &s->ddr_ram);
+ for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) {
+ SSIBus *spi_bus;
+ DeviceState *flash_dev;
+ qemu_irq cs_line;
+ char bus_name[6];
+
+ snprintf(bus_name, 6, "spi%d", i);
+ spi_bus = (SSIBus *)qdev_get_child_bus(DEVICE(&s->soc), bus_name);
+
+ flash_dev = ssi_create_slave(spi_bus, "sst25wf080");
+ cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
+
+ sysbus_connect_irq(SYS_BUS_DEVICE(&s->soc.spi[i]), 1, cs_line);
+ }
+
xlnx_ep108_binfo.ram_size = machine->ram_size;
xlnx_ep108_binfo.kernel_filename = machine->kernel_filename;
xlnx_ep108_binfo.kernel_cmdline = machine->kernel_cmdline;
--
1.9.1
prev parent reply other threads:[~2015-12-20 5:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-20 5:43 [Qemu-devel] [PATCH v6 0/6] Connect the SPI devices to ZynqMP Peter Crosthwaite
2015-12-20 5:43 ` [Qemu-devel] [PATCH v6 1/6] qdev: get_child_bus(): Use QOM lookup if available Peter Crosthwaite
2016-01-07 0:18 ` Alistair Francis
2016-01-07 0:25 ` Peter Crosthwaite
2016-01-08 0:04 ` Alistair Francis
2016-01-07 16:04 ` Peter Maydell
2015-12-20 5:43 ` [Qemu-devel] [PATCH v6 2/6] m25p80.c: Add sst25wf080 SPI flash device Peter Crosthwaite
2015-12-20 5:43 ` [Qemu-devel] [PATCH v6 3/6] ssi: Move ssi.h into a separate directory Peter Crosthwaite
2015-12-20 5:43 ` [Qemu-devel] [PATCH v6 4/6] xilinx_spips: Separate the state struct into a header Peter Crosthwaite
2015-12-20 5:43 ` [Qemu-devel] [PATCH v6 5/6] xlnx-zynqmp: Connect the SPI devices Peter Crosthwaite
2016-01-07 15:55 ` Peter Maydell
2016-01-15 15:21 ` Peter Maydell
2016-01-15 21:32 ` Alistair Francis
2015-12-20 5:43 ` Peter Crosthwaite [this message]
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=aa67be9cbe0b7108123d2aeece904a170427cd46.1450570397.git.crosthwaite.peter@gmail.com \
--to=crosthwaitepeter@gmail.com \
--cc=alistair.francis@xilinx.com \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--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).